I think i've almost got it!

        \$('#result').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");
                        alert ( id_select );
                        id_select = id_select.substr(1);
                        \$("#result").load('/pixel/pixel_creator.pl', 
{colorselect: color,
id_select: id_select});
        });

However in this code, it's getting "result" my container for all the
div's instead of the div ID "var id_select = \$(this).attr("id")" =
result not the inner divs ID.

I need to keep playing with this, but I thin i've almost got it.

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/

Reply via email to