$(function(){
$("#flash").slidy({
action: "click",
animation: "fade",
children: "li",
menu: true,
pause: true,
speed: 500,
time: 4000
});
dy_scroll('.ilist','.ileft','.iright','.ilist',5,true);// true为自动播放,不加此参数或false就默认不自动
});
function getboxhtml(data)
{
var t2="
";
for(var e in data)
{
t2+="- "+data[e]+"
";
}
t2+="
";
return t2;
}
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);});
}
}