I have a image and in it wants to be fadein fadeout automatically when the document is loaded and it should be done till the document is closed .. help me plzz
+1
A:
this'll do it:
$(function () {
$('#fader').fadeIn('slow', function () {
fadeItOut();
});
});
function fadeItIn() {
$('#fader').fadeIn('slow', function () {
fadeItOut();
});
}
function fadeItOut() {
$('#fader').fadeOut('slow', function () {
fadeItIn();
});
}
with
fader being the id of your image
Patricia
2010-08-10 17:06:10
+1 for the answer, even though I can't say I approve of the effect.
Ryan Kinal
2010-08-10 17:09:03
@Ryan: me neither, but hey, if he wants to bring back the 90's...
Patricia
2010-08-10 17:13:18
hey its a great logic loved it..
siddhartha
2010-08-12 13:00:13
A:
$( function() {
var t = 500;
setInterval( function(){
$('#id').fadeOut( t, function(){ $(this).fadeIn( t ); } );
}, 2*t);
});
id
is the image id and t
is the interval.
Erik Escobedo
2010-08-10 17:14:39