Web/js/indexBigPictureScorll.js
(开头部分) 4KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
/***********幻灯*****************/
auto=null;
timer=null;
var focus=new Function();
focus.prototype={
init:function(){
//默认动画频率
this.aTime=this.aTime || 10;
//默认间隔
this.sTime=this.sTime || 5000;
//图片容器
this.oImg=document.getElementById('focus_m').getElementsByTagName("ul")[0];
this.oImgLi=this.oImg.getElementsByTagName("li");
//左右按钮
this.oL=document.getElementById('focus_l');
this.oR=document.getElementById('focus_r');
//创建文字容器
this.createTextDom();
//默认第一帧
this.target=0;
//开始动画
this.autoMove();
//鼠标
this.oAction();
},
createTextDom:function(){
var that=this;
//创建文字容器
this.oText=document.createElement("div");
this.oText.className="focus_s";
var ul=document.createElement('ul');
var frag=document.createDocumentFragment();
for (var i=0;i<this.oImgLi.length;i++) {
var li=document.createElement("li");
li.innerHTML='<b></b>';
if (i==0) {
li.className="active";
};
frag.appendChild(li);
};
ul.appendChild(frag);
this.oText.appendChild(ul);
this.o.insertBefore(this.oText,this.o.firstChild);
//文字容器绑定动作
this.oTextLi=this.oText.getElementsByTagName("li");
},
autoMove:function(){
var that = this;
auto=setInterval(function(){that.goNext()},that.sTime);
},
goNext:function() {
this.target=this.nowIndex();
this.target==this.oTextLi.length-1 ? this.target=0:this.target++;
this.aStep=(this.target-this.nowIndex())*this.step;
this.removeClassName();
this.oTextLi[this.target].className="active";
this.startMove();
},
goPrev:function() {
this.target=this.nowIndex();
后面还有 111 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。
