/* ==�ֲ�{����|��������}== ��������{���|�߶�|���ִ�с|�զ��л�ʱ��} */ (function($){ dk_slideplayer = function(object,config){ this.obj = object; this.n =0; this.j =0; var _this = this; var t; var defaults = {width:"300px",height:"200px",fontsize:"12px",right:"0px",bottom:"3px",time:"5000"}; this.config = $.extend(defaults,config); this.count = $(this.obj + " li").size(); if(this.config.fontsize == "14px"){ this.size = "14px";this.height = "23px";this.right = "6px";this.bottom = "15px"; }else{ this.size = "12px";this.height = "21px";this.right = "6px";this.bottom = "10px"; } // download by this.factory = function(){ //Ԫ�ض�λ $(this.obj).css({position:"relative",zindex:"0",margin:"0",padding:"0",width:this.config.width,height:this.config.height,overflow:"hidden"}) $(this.obj).prepend("
"); $(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:"#000",opacity:"0.4",overflow:"hidden"}) //������� $(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:"#ffffff",background:"none",opacity:"1",overflow:"hidden"}); if(i!= 0){$(this).hide()} }); this.slide(); this.addhover(); t = setinterval(this.autoplay,this.config.time); } //ͼƭ��ӱ this.slide = function(){ $(this.obj + " div a").mouseover(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('mouseover'); } //��ҳ���� this.resetclass =function(obj,i){ $(obj).css({float:"left",marginright:"3px",width:"15px",height:"14px",lineheight:"15px",textalign:"center",fontweight:"800",fontsize:"12px",color:"#000",background:"#ffffff",cursor:"pointer"}); $(obj).eq(i).css({color:"#ffffff",background:"#ff7d01",textdecoration:"none"}); } this.factory(); } })(jquery)