Examples
Change the way you handle events with "Distill". Don't couple your events to domnodes. Let them bubble.
Example
Below you will find an example. This example needs the jQuery library.
Want to see a working version?
<html>
<head>
<title>Distill</title>
<script src="jquery-1.2.1.js"></script>
<script src="distill.js"></script>
<script>
//attach a keyup and a select
//handler to the textarea
window.onload = function ()
{
$.distill("keyup,select,click",{
myobj :{
select: function() {
alert("textarea 1 select");
},
keyup: function() {
alert("textarea 1 keyup");
}
},
myobj2: {
click: function() {
alert("textarea 2 click");
},
keyup: function() {
alert("textarea 2 keyup");
}
}
});
}
</script>
</head>
<body>
<textarea class='bla com_myobj'>text 1</textarea>
<textarea class='com_myobj2'>text 2</textarea>
</body>
</html>
