It still has a very small bit of lag to it, but I think its a lot faster with the event delgation.
Anyway we can clean this up a bit more? \$('#pixel-grid').click(function(e) { if ( \$(e.target).is('.button px') ) var color = \$("input#color_code").val(); \$(this).css({ backgroundColor:color }); color = color.substr(1); var id_select = \$(this).attr("id"); var id_select = \$(e.target).parent('div').attr('id'); id_select = id_select.substr(1); \$("#result").load('/pixel/pixel_creator.pl', {colorselect: color, id_select: id_select}); }); On Sep 7, 1:32 am, Ca-Phun Ung <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Whoa just looking that and all the documentation makes it look way > > over my head for a newbie ;). > > Yup, I could imagine but it is quite simple when you realise what is > involved. I did a write-up on this topic recently that might be of some > help [1]. > > > If I did this, would binding with livequery not be needed anymore? As > > some of the docs ive read, they say things like using Event Delegation > > will make it where you no longer need to bind those events. > > Correct. > > [1]http://yelotofu.com/2008/08/javascript-event-delegation/