3

I need a div to glow from a color to another and vice-versa. This is what I did using shadow animation jQuery Plugin: jsFiddle and it works well... but when I refresh the page it doesn't load and I get this error:

Maximum execution time of 30 seconds exceeded

How can I fix it?

7
  • 2
    +1 for your great effort. I'd suggest that you try setinterval for the same Commented Aug 21, 2013 at 17:00
  • 2
    That looks like a PHP error (server-side). jQuery is client-side. You have a problem somewhere else, I would guess. Commented Aug 21, 2013 at 17:01
  • What browser? OS? I can't get an error on FireFox 23 (Win XP) Commented Aug 21, 2013 at 17:01
  • Is there some server end tech involved? Commented Aug 21, 2013 at 17:06
  • 1
    Your fiddle does not show any error using Chrome. Commented Aug 21, 2013 at 17:09

2 Answers 2

1

I don't get an error, but just in case it works for you, try replacing

function(){
    shadow_normal();
}

with

function(){
    window.setTimeout(shadow_normal, 1);
}

and same with shadow_animar.

0
1

You don't need a plugin to do this... this snippet will toggle between red and yellow at 1/2 second flux (you can edit the colors and delay as necessary).

var toggleColor = function() {
    window.nextColor = window.nextColor == '#f00' ? '#ff0' : '#f00';
    $('#content').animate({'background-color': window.nextColor}, 500, toggleColor);
};
toggleColor();

Not the answer you're looking for? Browse other questions tagged or ask your own question.