软件下载 | 资讯教程 | 最近更新 | 下载排行 | 一键转帖 | 发布投稿
您的位置:最火下载站 > Web前端 > Ajax/JavaScript > JavaScript 图片可控制的切换效果

JavaScript 图片可控制的切换效果

??????????????‘(LieHuo.Net)????¨? ?????°alibaba?????????????‰???????????????????觉???é”??????????????”¨?”¨????????????????¤§?????????????????????è?????è???·±?????§??? ?”±?????‰??????????‰???‘??¨?±??¤?????????????é????????è??????°±?????“??—?¤??????? è????????Tween??“??¨???????°±??????é???–°???è??è??????????????è?‘?????‰????—?é—??????????????????¨?‰???????é?¤????”????Tween??“??¨???????”?è??????¨??????—?????????è????????è??????????·??????

????…???????????????”?¤????




     

????¨????è?????

??????????°±???é??è??????–?è???????‘??¨???è±????left(?°??????????)?’?top(????????????)????????°????‰????????????¨????????????

???é?–?…?é??è?????????????¨????¨???????è????¨è??????????¨overflow???hidden???????????????????????–???????????????????—?è?????position???relative???
??‘??¨???è±????è???????????????????????

?????????????”¨?????…??????
var p = CurrentStyle(this._container).position;
p == "relative" || p == "absolute" || (this._container.style.position = "relative");
this._container.style.overflow = "hidden";
this._slider.style.position = "absolute";

??????????????‰è?????Change???????????°?±???§??????è????¨????????‘??¨???è±?è?·??–???

?????????????”¨?????…??????
this.Change = this.options.Change ? this.options.Change :
this._slider[bVertical ? "offsetHeight" : "offsetWidth"] / this._count;

????‰§è??Run?–?????°±???????§?è???…???????????…??????‰?????????é?‰?????°?”¨???é???–°è?????è???????????????‰??????????

?????????????”¨?????…??????
index == undefined && (index = this.Index);
index < 0 && (index = this._count - 1) || index >= this._count && (index = 0);
== undefined && (index = this.Index);
index < 0 && (index = this._count - 1) || index >= this._count && (index = 0);

??????????°±??°è?????????”¨tween??“??¨?—?é??è??????????°??????
?????…???_target(?????????)???_t(?—?é—?)???_b(????§????)?’?_c(?????–é??)???

?????????????”¨?????…??????
this._target = -Math.abs(this.Change) * (this.Index = index);
this._t = 0;
this._b = parseInt(CurrentStyle(this._slider)[this.options.Vertical ? "top" : "left"]);
this._c = this._target - this._b;

???è????‰Duration(???????—?é—?)???è???????‰?±???§???

????????°è????????????°±?‰§è??Move?¨????????§??§???¨??????é??é??????????????é?–?…???¤?–?_c????????‰????????‰???0è?¨?¤????é??è???§???¨??‰?’?_t????????°è??Duration?????????è?????????°±??§????§???¨????????????????§???¨??°????????????è??è????????????????????

?????????????”¨?????…??????
if (this._c && this._t < this.Duration) {
    this.MoveTo(Math.round(this.Tween(this._t++, this._b, this._c, this.Duration)));
    this._timer = setTimeout(Bind(this, this.Move), this.Time);
}else{
    this.MoveTo(this._target);
    this.Auto && (this._timer = setTimeout(Bind(this, this.Next), this.Pause));
}

相关阅读
栏目导航
推荐软件