/*幻灯片样式*/ function slideclass(dividname){ //幻灯节点对象 this.divobj=$("#"+dividname); //大图节点对象 this.divbigimgobj=$("#"+dividname+" .list"); this.bigliarr=$("#"+dividname+" ul li"); //缩略图节点对象 this.divobj.append("
"); this.divthumbobj=$("#"+dividname+" .thumb"); this.thumbliobj=null; //其他设置 this.index=0; this.timeer=null; this.speed=4000;//切换速度 } /** * 初始化 */ slideclass.prototype.init=function(n){ this.setcenter(); this.setbtn(); this.bindevt(); this.showone(); this.play(); } /** * 设置按钮,没有原始宽度直接忽略 */ slideclass.prototype.setcenter = function(){ this.bigliarr.find('img').each(function(){ var oldw=$(this).attr("oldw"); if(oldw==undefined || oldw==null){ return false; } $(this).css({'margin-left':"-"+oldw/2+"px",'position':'relative','left':"50%"}); }) } /** * 设置按钮 */ slideclass.prototype.setbtn = function(){ var width=parseint(17* this.bigliarr.length, 10); this.divthumbobj.css({"width": width + "px","height":"12px","position":"relative","left":"50%","bottom":"25px","margin-left":"-"+(width/2)+"px"}); // var thehtml = "