Update jQuery UI Widget Options
We're all used to passing options when instantiating an object, whether it be JavaScript or any other language. Whether or not you can update those options later is usually up to the framework, and somehow many wont let you update them once they've been passed in. Depending on how the initialization of the object is done, sometimes that makes sense, but in most cases you should be able to update an option at any given time.
I recently needed to update a jQuery UI widget option and here's how you update any given option:
this.$editor.inlineEditor('option', 'forceOpen', true);
jQuery UI is mostly a legacy technology these days so I'm mostly passing this tip on for those having to maintain old code. This does teach a good lesson: always provide a method for modifying initial options, even if you don't foresee a reason to do so!
CSS animations are right up there with sliced bread. CSS animations are efficient because they can be hardware accelerated, they require no JavaScript overhead, and they are composed of very little CSS code. Quite often we add CSS transforms to elements via CSS during...
Chances are that any Web designers using our Ghostlab browser testing app, which allows seamless testing across all devices simultaneously, will have worked with responsive design in some shape or form. And as today's websites and devices become ever more varied, a plethora of responsive images...
CSS class name structure and consistency is really important; some developers camelcase classnames, others use dashes, and others use underscores. One thing I've learned when toying around by HTML and CSS class names is that you can actually use unicode symbols and icons as classnames.
Front-end developing is beautiful, and it's getting prettier by the day. Nowadays we got so many concepts, methodologies, good practices and whatnot to make our work stand out from the rest. Javascript (along with its countless third party libraries) and CSS have grown so big, helping...