Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

using jquery to transition between images

I have two images that are of same size and text but different colors (they are used as logos). I would like to slowly automatically transition between the two images using jQuery. First, I was going to make a GIF image out of the two images but then thought that perhaps jQuery can be used.

Is this possible with jQuery?

I want the transition to happen without any input from the user and it can happen every X seconds.

Please let me know how this can be done.

like image 864
Anthony Avatar asked Oct 09 '22 12:10

Anthony


2 Answers

I think this would definitely help

http://addyosmani.com/blog/css3transitions-jquery/

also this

http://jquery-howto.blogspot.com/2009/05/replacing-images-at-time-intervals.html

here is a jquery plugin for this

http://plugins.jquery.com/project/bgImageTransition

like image 114
Praveen Gowda I V Avatar answered Oct 13 '22 12:10

Praveen Gowda I V


Yes, you can put the new image on top of the current one, using absolute positioning, then use fadeTo to fade in the new image. You can use a simple setInterval to make this happen periodically.

EDIT: fadeTo lets you go to a specific level of transparency. Easier just to use fadeIn, which will go from 100% to 0% transparency.

like image 45
dnuttle Avatar answered Oct 13 '22 12:10

dnuttle