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...
How is it possible that JavaScript-based animation has secretly always been as fast — or faster — than CSS transitions? And, how is it possible that Adobe and Google consistently release media-rich mobile sites that rival the performance of native apps?
This article serves as a point-by-point...
It's often interesting to think about where on a given element, whether it be the page, an image, or a static DIV, your users are clicking. With that curiosity in mind, I've created HeatMap: a MooTools class that allows you to detect, load, save, and...
I often qualify a great website by one that pay attention to detail and makes all of the "little things" seem as though much time was spent on them. Let's face it -- FAQs are as boring as they come. That is, until you...