www.gusucode.com > 4128网博士成品网站管理系统 PHP网站源码程序 > 4128/4128/photo/js/photorollx3_dolphin.js
$(document).ready(function() { $("img#photorollx3_dolphinpic_0").show(); setInterval("$().photorollx3dolphin()", 4000); (function($){ $.fn.photorollx3dolphin = function(){ var rollobj=$(".photorollx3_dolphinpic"); var rolltotal=parseInt(rollobj.size())-1; var nextId,nowId; $("img.photorollx3_dolphinpic").each(function(){ if(this.style.display=='block' || this.style.display=='inline'){ nowId=parseInt(this.id.substr(23)); if(nowId>=rolltotal){ nextId=0; }else{ nextId=nowId+1; } } }); $("img#photorollx3_dolphinpic_"+nextId).fadeIn('slow').show('slow'); $("img#photorollx3_dolphinpic_"+nowId).fadeOut('slow').hide(); }; })(jQuery); });