开发者

change image after timeout

i have following code

   <div class="caption" style=" position:absolute; mar开发者_JAVA百科gin-top:0px">
   <img src="caption/img1.png" />
   </div>


 <script>
$(document).ready(function(){     
setTimeout(function() {
$('div.caption').fadeOut('slow');
$('div.caption').fadeIn();
}, 1000);

});

but this work only once, what i want to do is after every 1000ms function should run and change image in div "caption" i have image series and i can put their names in array.


You can try the following:

http://malsup.com/jquery/cycle/


setInterval takes the same arguments as setTimeout but it executes the function every n milliseconds, as specified. see more here

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜