Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Fade with jQuery while also changing font-style and text Re: Fade with jQuery while also changing font-style and text

#131100
CrocoDillon
Participant

Can maybe help you on the fade bug, edit line 29 to:

$(this).css(‘font-style’,’normal’);

because `$(this).removeAttr(‘style’);` removes the opacity added by jQuery’s fade function too. Hope that helps.

EDIT: That and the total interval time is 4000ms, each fade is 200ms and the normal state is 2000ms… so that leaves 1200ms for the italic state since there are 4 fades total (4000 – 4×200 – 2000). You can either make the total interval time 4800ms or the normal state 1600ms.

Another EDIT: @Podders, the problem with using an interval is they sort of ‘keep running’ when the window loses focus. So when your tabbed out for a while and come back it skipped half the alphabet. Maybe it doesn’t matter here but else using timeouts instead might help.