[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 });
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.subst
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")
Ca-Phun Ung wrote:
> OK so I was right - you do have a double equal sign in your code! Change:
> $(this).css(background-color) == p_color;
>
> to
>
> $(this).css(background-color) = p_color;
>
Actually, there shouldn't be an equal sign in the first place because
the css() acts as both a gette
[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 th
Whoa just looking that and all the documentation makes it look way
over my head for a newbie ;).
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.
[EMAIL PROTECTED] wrote:
> http://hertzelle.com/pixel/ is where the demo is currently running.
> Before you click you will see what is happening to the "grid" the
> color is not returning to it's previous state.
>
OK so I was right - you do have a double equal sign in your code! Change:
$(this
http://hertzelle.com/pixel/ is where the demo is currently running.
Before you click you will see what is happening to the "grid" the
color is not returning to it's previous state.
Also, is there a better way or FASTER way to make these remote
requests. If you see my demo you will notice it takes
[EMAIL PROTECTED] wrote:
> \$(".button").hover(function () {
> var color = \$("input#color_code").val();
> var p_color = \$(this).css("background-color");
> \$(this).css({ backgroundColor:color });
> }, function () {
> \$(this
You're right that was super easy!
Now, I have one more problem to solve that I cannot figure out (it's a
cosmetic problem.)
Basically, I want the div to "light up" with the users select color,
however, if they do not click, change it back to the color it was
before. Here is my code snip-it for t
Look at this:
http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_AJAX_request.3F
On 5 Sep., 13:40, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Thank you for showing me the correct way to do that?
>
> My next question really is, why after the user clicks
[EMAIL PROTECTED] wrote:
> Thank you for showing me the correct way to do that?
>
> My next question really is, why after the user clicks on my div, does
> the content reload from creator.pl does jQuery stop watching the
> pixels inside #results. It doesnt do my hover effect and you cannot
> click
Thank you for showing me the correct way to do that?
My next question really is, why after the user clicks on my div, does
the content reload from creator.pl does jQuery stop watching the
pixels inside #results. It doesnt do my hover effect and you cannot
click on any of the divs to re-send creat
Hi,
[EMAIL PROTECTED] wrote:
> How can I get jQuery to use the new divs that are populated as a
> result of an .ajax request.
>
What you want is the Ajax load method, see
http://docs.jquery.com/Ajax/load#urldatacallback
> \$.ajax({
> type: "POST",
>
14 matches
Mail list logo