|
");
$(this.obj + " li").css({position:"absolute",top:"0",left:"0",width:"100%",height:"100%",overflow:"hidden"}).each(function(i){
$(_this.obj + " div").append(""+(i+1)+"");
});
$(this.obj + " img").css({border:"none",width:"100%",height:"100%"})
this.resetclass(this.obj + " div a",0);
$(this.obj).prepend("");
$(this.obj + " .dkTitleBg").css({position:"absolute",margin:"0",padding:"0",zIndex:"1",bottom:"0",left:"0",width:"100%",height:_this.height,background:"rgb(204,204,204)",opacity:"0.4",overflow:"hidden",bottom:"-20px"})
$(this.obj).prepend("");
$(this.obj + " p").each(function(i){
$(this).appendTo($(_this.obj + " .dkTitle")).css({position:"absolute",margin:"0",padding:"0",zIndex:"2",bottom:"0",left:"0",width:"100%",height:_this.height,lineHeight:_this.height,textIndent:"5px",textDecoration:"none",fontSize:_this.size,color:"#000",background:"#ccc",opacity:"1",overflow:"hidden",bottom:"-20px",textAlign:"center"});
if(i!= 0){$(this).hide()}
});
this.slide();
this.addhover();
t = setInterval(this.autoplay,this.config.time);
}
this.slide = function(){
$(this.obj + " li:eq(" + _this.j + ")").show().siblings("li").hide();
$(this.obj + " div a").click(function(){
_this.j = $(this).text() - 1;
_this.n = _this.j;
if (_this.j >= _this.count){return;}
$(_this.obj + " li:eq(" + _this.j + ")").fadeIn("200").siblings("li").fadeOut("200");
$(_this.obj + " .dkTitle p:eq(" + _this.j + ")").show().siblings().hide();
_this.resetclass(_this.obj + " div a",_this.j);
});
}
this.addhover = function(){
$(this.obj).hover(function(){clearInterval(t);}, function(){t = setInterval(_this.autoplay,_this.config.time)});
}
this.autoplay = function(){
_this.n = _this.n >= (_this.count - 1) ? 0 : ++_this.n;
$(_this.obj + " div a").eq(_this.n).triggerHandler('click');
}
this.resetclass =function(obj,i){
$(obj).css({float:"left",marginRight:"3px",width:"15px",height:"14px",lineHeight:"15px",textAlign:"center",fontWeight:"800",fontSize:"10px",color:"#FFF",background:"rgb(9,9,9)",cursor:"pointer"});
$(obj).eq(i).css({color:"#FFFFFF",background:"rgb(206,6,9)",textDecoration:"none"});
}
this.factory();
}
new dk_slideplayer("#pub_slideplay",{width:"254px",height:"175px",fontsize:"12px",time:"5000"});
|
|