Created
October 22, 2009 22:11
-
-
Save lightscalar/216392 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.observe("widget:frobbed", function(event) { | |
console.log("Element with ID (" + event.target.id + | |
") frobbed widget #" + event.memo.widgetNumber + "."); | |
}); | |
var someNode = $('foo'); | |
someNode.fire("widget:frobbed", { widgetNumber: 19 }); | |
//-> "Element with ID (foo) frobbed widget #19." | |
When attaching event handlers via Prototype, I've done the following | |
in the past... | |
Event.observe(window, 'load', function () { | |
}); | |
...or stuff like... | |
Event.observe(element_to_observe, 'change', | |
event_handler_function_X ); | |
...so try ... | |
var r = Raphael('plot',100,100); | |
var plot = r.rect(0,0,100,100); | |
Event.observe(plot, 'mousemove', function () { | |
alert("Did it work?"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment