The “change” event on a radiobutton input only fires when it becomes selected. If you want to trigger some behaviour on an unselected radiobutton, then you have to bind to the change event of the radiogroup, which you can do like so: <ul> <li> <input id="r1" name="something" type="radio" value="basic" /> <label for="r1">Basic</label> </li> <li> <input… Read more »
Posts Tagged: javascript
Javascript EventEmitter Redux, now on github
I’ve added some more features to the EventEmitter mixin (like actually working listener removal) and posted it to github: EventEmitter on github It’s fairly simple to use … something like this: var MyKlass = function() {}; EventEmitter.augment(MyKlass.prototype); /** * Show me * * @fires shown */ MyKlass.prototype.showMe = function() { this.trigger('shown', {'visible':true}); } var myInstance… Read more »
Started work on jQuery UI Modal widget
I’ve started working a jQuery UI Modal widget, for use in a project built on top of the widget library. We have very high accessibility standards, and the current “{modal:true}” option for the dialog widget unfortunately wasn’t as good as we needed. Seeing that the team had identified the need for a standalone Modal widget,… Read more »
CSSP: Loading CSS with Javascript – and getting an onload callback.
It seems fairly straightforward to require CSS with Javascript. The most obvious method that I thought of was creating a <link> tag and appending it to the head of the document. An alternative would be to load the text of the css file with an ajax XHR call, and then inject that into a <style>… Read more »
BBC Fisheye Greasemonkey Script
Greasemonkey script to reformat “Author” select elements on the BBC’s Fisheye repository browser, which are ridiculously long (because they contain a considerable chunk of certificate data) which messes with the whole page layout. Shrinking the selects to a more reasonable width fixes this and makes the site more usable. http://otaqui.com/code/bbc-fisheye/bbc-fisheye.user.js // ==UserScript== // @name BBC… Read more »