|
|||||||
New to SitePoint Forums? Register here for free!
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
SitePoint Enthusiast
![]() Join Date: Apr 2002
Location: chicago
Posts: 75
|
fadein background image
Can a background css image be faded in using jQuery ... I tried putting
$(this).fadeIn("slow").css('background-image', 'url(EggA_' + eid + '.gif)'); and it did not work see code below, this flickers when you click on it html Code:
JavaScript Code:
|
|
|
|
|
|
#2 |
|
Tool
![]() ![]() ![]() ![]() Join Date: Sep 2005
Location: Cambridge, UK
Posts: 3,804
|
Wow, a classic WTF example of when an abstraction layer interferes and stops people from using much simpler code! I'm referring to this bit:
javascript Code:
javascript Code:
Regarding the problem you've asked about, with the code you posted at the top, the problem is likely that the background image is being applied with every iteration of the fading process. Try it the other way round: javascript Code:
|
|
|
|
|
|
#3 |
|
SitePoint Enthusiast
![]() Join Date: Apr 2002
Location: chicago
Posts: 75
|
Thanks for the ideas.
The fade needs to be applied when you click I am not sure where to put it then? JavaScript Code:
|
|
|
|
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
|
All times are GMT -7. The time now is 22:31.












Linear Mode
