document.write("") document.write("
") document.write("
") document.write("
") var slide_gid = function (id) { return "string" == typeof id ? document.getElementById(id) : id; }; var SlideClass = { create: function() { return function() { this.initialize.apply(this, arguments); } } } var SlideObjectExtend = function(destination, source) { for (var property in source) { destination[property] = source[property]; } return destination; } var TransformView = SlideClass.create(); TransformView.prototype = { //容器工具,滑动工具,切换参数,切换数目 initialize: function(container, slider, parameter, count, options) { if(parameter <= 0="" ||="" count=""><= 0)="" return;="" var="" ocontainer="slide_gid(container)," oslider="slide_gid(slider)," othis="this;" this.index="0;//当前索引" this._timer="null;//定时器" this._slider="oSlider;//滑动工具" this._parameter="parameter;//切换参数" this._count="count" ||="" 0;//切换数目="" this._target="0;//目的参数" this.se="" tions(options);="" this.up="!!this.options.Up;" this.step="Math.abs(this.options.Step);" this.time="Math.abs(this.options.Time);" this.auto="!!this.options.Auto;" this.pause="Math.abs(this.options.Pause);" this.onstart="this.options.onStart;" this.onfinish="this.options.onFinish;" ocontainer.style.overflow="hidden" ;="" ocontainer.style.position="relative" ;="" oslider.style.position="absolute" ;="" oslider.style.="oSlider.style.left" =="" 0;="" },="" 设置默许属性="" se="" tions:="" function(options)="" {="" this.options="{//默认值" up:="" true,//是不是向上(不然向左)="" step:="" 5,//滑动转变率="" time:="" 10,//滑动延时="" auto:="" true,//是不是主动转换="" pause:="" 2000,//停留工夫(auto为true时有效)="" onstart:="" function(){},//最先转换时实行="" onfinish:="" function(){}//完成转换时实行="" };="" slideobjectextend(this.options,="" options="" ||="" {});="" },="" 最先切换设置="" start:="" function()="" {="" if(this.index="">< 0){="" this.index="this._count" -="" 1;="" }="" else="" if="" (this.index="">= this._count){ this.Index = 0; } this._target = -1 * this._parameter * this.Index; this.onStart(); this.Move(); }, //挪动 Move: function() { clearTimeout(this._timer); var oThis = this, style = this.Up ? " " : "left", iNow = parseInt(this._slider.style[style]) || 0, iStep = this.GetStep(this._target, iNow); if (iStep != 0) { this._slider.style[style] = (iNow + iStep) + "px"; this._timer = setTimeout(function(){ oThis.Move(); }, this.Time); } else { this._slider.style[style] = this._target + "px"; this.onFinish(); if (this.Auto) { this._timer = setTimeout(function(){ oThis.Index++; oThis.Start(); }, this.Pause); } } }, //获得步长 GetStep: function(iTarget, iNow) { var iStep = (iTarget - iNow) / this.Step; if (iStep == 0) return 0; if (Math.abs(iStep) < 1)="" return="" (istep=""> 0 ? 1 : -1); return iStep; }, //住手 S : function(iTarget, iNow) { clearTimeout(this._timer); this._slider.style[this.Up ? " " : "left"] = this._target + "px"; } }; SlashFixBug=function(){ function Each(list, fun){ for (var i = 0, len = list.length; i < len;="" i++)="" {="" fun(list[i],="" i);="" }="" };="" var="" objs="slide_gid(" idnumtheme").getelementsbytagname("li");"="" var="" tv="new" transformview("idtransformviewtheme",="" "idslidertheme",="" 220,="" objs.length,="" {="" onstart="" :="" function(){="" each(objs,="" function(o,="" i){="" o.classname="tv.Index" =="i" "on"="" :="" "";="" })="" }//按钮款式="" });="" tv.start();="" each(objs,="" function(o,="" i){="" o.onmouseover="function(){" o.classname="on" ;="" tv.auto="false;" tv.index="i;" tv.start();="" }="" o.onmouseout="function(){" o.classname="" ;="" tv.auto="true;" tv.start();="" }="" })="" }="" if="" (window.attachevent)="" {="" window.attachevent("onload",="" slashfixbug);="" }="" else="" if="" (window.addeventlistener)="" {="" window.addeventlistener("load",="" slashfixbug,="" false);="" }="">
")