//图片滚动
var s=function(){
var interv=2000; //切换间隔时间
var interv2=10; //切换速度
var opac1=70; //文字背景的透明度
var source="show" //焦点轮换图片容器的id名称
//获取对象
function gettag(tag,obj){
if(obj==null){
return document.getelementsbytagname(tag);
}else{
return obj.getelementsbytagname(tag);
}
}
function getid(id){
return document.getelementbyid(id);
};
var opac=0,j=0,t=63,num,scton=0,timer,timer2,timer3;
var id=getid(source);
id.removechild(gettag("div",id)[0]);
var li=gettag("li",id);
var div=document.createelement("div");
var title=document.createelement("div");
var span=document.createelement("span");
var button=document.createelement("div");
button.classname="button";
for(var i=0;i
0){
timer=settimeout(fadeout,interv2);
}else{
if(j3){
timer3=settimeout(scrolltxt,interv2);
}else if(num>0 && t<62){
timer3=settimeout(scrolltxt,interv2);
}else{
scton=0
}
};
fadeon();
}
//初始化
window.onload=s;
//图片无缝滚动
$.fn.imgscroll = function(o){
var defaults = {
speed: 40,
amount: 0,
width: 1,
dir: "left"
};
o = $.extend(defaults, o);
return this.each(function(){
var _li = $("li", this);
_li.parent().parent().css({overflow: "hidden", position: "relative"}); //div
_li.parent().css({margin: "0", padding: "0", overflow: "hidden", position: "relative", "list-style": "none"}); //ul
_li.css({position: "relative", overflow: "hidden"}); //li
if(o.dir == "left") _li.css({float: "left"});
//初始大小
var _li_size = 0;
for(var i=0; i<_li.size(); i++)
_li_size += o.dir == "left" ? _li.eq(i).outerwidth(true) : _li.eq(i).outerheight(true);
//循环所需要的元素
if(o.dir == "left") _li.parent().css({width: (_li_size*3)+"px"});
_li.parent().empty().append(_li.clone()).append(_li.clone()).append(_li.clone());
_li = $("li", this);
//滚动
var _li_scroll = 0;
function goto(){
_li_scroll += o.width;
if(_li_scroll > _li_size)
{
_li_scroll = 0;
_li.parent().css(o.dir == "left" ? { left : -_li_scroll } : { top : -_li_scroll });
_li_scroll += o.width;
}
_li.parent().animate(o.dir == "left" ? { left : -_li_scroll } : { top : -_li_scroll }, o.amount);
}
//开始
var move = setinterval(function(){ goto(); }, o.speed);
_li.parent().hover(function(){
clearinterval(move);
},function(){
clearinterval(move);
move = setinterval(function(){ goto(); }, o.speed);
});
});
};