仿淘宝首页图片切换,很好的一个图片切换效果。
现在淘宝改版了,右下角的按钮变成圆形,不过大体上还是差不多的。这个效果你可以拿来就用,如果你看一下这个效果的源代码,或许还会有不少的收获。先来看效果演示吧~
效果演示
Javascript Code
var $$ = function (id) { return "string" == typeof id ? document.getElementById(id) : id; }; var Extend = function (destination, source) { for (var property in source) { destination[property] = source[property]; } return destination; } var CurrentStyle = function (element) { return element.currentStyle || document.defaultView.getComputedStyle(element, null); } var Bind = function (object, fun) { var args = Array.prototype.slice.call(arguments).slice(2); return function () { return fun.apply(object, args.concat(Array.prototype.slice.call(arguments))); } } var forEach = function (array, callback, thisObject) { if (array.forEach) { array.forEach(callback, thisObject); } else { for (var i = 0, len = array.length; i= this._count && (index = 0); //设置参数 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; this.onStart(); this.Move(); }, //移动 Move: function () { clearTimeout(this._timer); //未到达目标继续移动否则进行下一次滑动 if (this._c && this._t 本文地址:http://www.nowamagic.net/librarys/veda/detail/574,欢迎访问原出处。