function DY_scroll(wraper,prev,next,img,speed,or) { var wraper = $(wraper); var prev = $(prev); var next = $(next); var img = $(img).find('ul'); var w = img.find('li').outerWidth(true); var s = speed; next.click(function() { img.animate({'margin-left':-w},function() { img.find('li').eq(0).appendTo(img); img.css({'margin-left':0}); }); }); prev.click(function() { img.find('li:last').prependTo(img); img.css({'margin-left':-w}); img.animate({'margin-left':0}); }); if (or == true) { ad = setInterval(function() { next.click();},s*1000); wraper.hover(function(){clearInterval(ad);},function(){ad = setInterval(function() { next.click();},s*1000);}); } } $(function(){ var cname=""; $("#nav li").hover(function(){ cname=$(this).attr("class"); if(!cname){$(this).addClass("hover");} $("dl",this).show(); },function(){ $("dl",this).hide(); if(!cname){$(this).removeClass("hover"); } }); // DY_scroll('.prolist','.arrow_left','.arrow_right','.prolist',3,true); })