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!
This is the hardest thing I've ever had to write, much less admit to myself. I've written resignation letters from jobs I've loved, I've ended relationships, I've failed at a host of tasks, and let myself down in my life. All of those feelings were very...
CSS animations aren't just for basic fades or sliding elements anymore -- CSS animations are capable of much more. I've showed you how you can create an exploding logo (applied with JavaScript, but all animation is CSS), an animated Photo Stack, a sweet...
Yesterday I created a tutorial showing you how you can shake an element using Fx.Shake, a MooTools component written by Aaron Newton. It turns out that jQuery UI also has a shake effect which can draw attention to an element.
The XHTML
Exactly the same as...
I know I've harped on this over and over again but it's important to enhance pages for print. You can do some things using simple CSS but today's post features MooTools and jQuery. We'll be taking the options of a SELECT element and generating...