[EMAIL PROTECTED] wrote:
> 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});
>       });
>   
You're setting id_select twice - remove the first one. You could also 
try playing with the syntax to get it shorter.

Reply via email to