0

Look at this code snippet:

$('#clickme').click(function(){blinkText($('#SendedText')); });

function blinkText(element)
{
    $(element).fadeIn('slow');
    $(element).fadeOut('slow');
}

http://jsfiddle.net/aXMtH/5/

This code works fine in all browsers except Firefox 3. Why does Firefox show and hide text so slowly? How can I fix this behavior?

genesis
  • 50,477
  • 20
  • 96
  • 125
Neir0
  • 12,849
  • 28
  • 83
  • 139

2 Answers2

1

There's nothing wrong with your code that could case the slowdown. However, try to change

$(element)

to

element

because your element is already an jQuery object. If that won't work, that's probably a bug in your Firefox version. It's already version 7 now...

http://jsfiddle.net/aXMtH/6/

function blinkText(element)
{
    element.fadeIn('slow');
    element.fadeOut('slow');
}
genesis
  • 50,477
  • 20
  • 96
  • 125
  • @Tules: maybe it was the problem – genesis Oct 18 '11 at 13:14
  • I doubt it, animations in general tend to be sluggish in older browsers, no offence to you bro, I'm just saying he shouldn't just accept the first answer, it should be the most relevant – Tules Oct 18 '11 at 13:21
1

Firefox 3 is an old browser, there is nothing wrong with your code and you can no more fix this problem than you can alter previous releases of firefox. If it's really bothering you you could use browser detection and do something simpler for FF3 and older

// Select Firefox under 3.x
if (jQuery.browser.mozilla && jQuery.browser.version <= '1.9') {
// alternative behavior.
}
Tules
  • 4,905
  • 2
  • 27
  • 29