// javascript document jquery(function($) { var index = 0; var maximg = 5; //$('
').appendto("#myjquery"); //滑动导航改变内容 $("#myjquerynav li").hover(function() { if (mytime) { clearinterval(mytime); } index = $("#myjquerynav li").index(this); mytime = settimeout(function() { showjqueryflash(index); $('#myjquerycontent').stop(); }, 400); }, function() { clearinterval(mytime); mytime = setinterval(function() { showjqueryflash(index); index++; if (index == maximg) { index = 0; } }, 3000); }); //滑入 停止动画,滑出开始动画. $('#myjquerycontent').hover(function() { if (mytime) { clearinterval(mytime); } }, function() { mytime = setinterval(function() { showjqueryflash(index); index++; if (index == maximg) { index = 0; } }, 3000); }); //自动播放 var mytime = setinterval(function() { showjqueryflash(index); index++; if (index == maximg) { index = 0; } }, 3000); }); function showjqueryflash(i) { $("#myjquerycontent div").eq(i).animate({ opacity: 1 }, 1000).css({ "z-index": "1" }).siblings().animate({ opacity: 0 }, 1000).css({ "z-index": "0" }); //$("#flow").animate({ left: 652+(i*76) +"px"}, 300 ); //滑块滑动 $("#myjquerynav li").eq(i).addclass("current").siblings().removeclass("current"); }