您好,欢迎访问一九零五行业门户网

图片轮播_html/css_WEB-ITnose

当滚动到第四张图片时,会快速滚到第三张,第二张,第一张图片
当我想轮播时,第四张轮播玩就滚到第一张,
回复讨论(解决方案) 看看这个咯
http://bbs.blueidea.com/thread-3049362-1-1.html
你轮播的时候是不是有个index值啊,在轮播到第四张的时候改为1
https://github.com/idiot/unslider/blob/master/src/unslider.js
我是用这个插件来做的
(function (e, t) { var n = function () { function r(t, r) { if (t == dot) { r = ''; e.each(n.li, function (e) { r += '' + ++e + }); r += } else { r = '' + r + t + ' prev>' + n.o.prev +
+ r + t + ' next>' + n.o.next +
} n.el.addclass(has- + t + s).append(r).find(. + t).click(function () { var t = e(this); t.hasclass(dot) ? n.stop().to(t.index()) : t.hasclass(prev) ? n.prev() : n.next() }) } var n = this; n.o = { speed: 500, delay: 3e3, init: 0, pause: !t, loop: !t, keys: t, dots: t, arrows: t, prev: ←, next: →, fluid: t, starting: t, complete: t, items: >ul, item: >li, easing: swing, autoplay: true }; n.init = function (t, i) { n.o = e.extend(n.o, i); n.el = t; n.ul = t.find(n.o.items); n.max = [t.outerwidth() | 0, t.outerheight() | 0]; n.li = n.ul.find(n.o.item).each(function (t) { var r = e(this), i = r.outerwidth(), s = r.outerheight(); if (i > n.max[0])n.max[0] = i; if (s > n.max[1])n.max[1] = s }); var i = n.o, s = n.ul, o = n.li, u = o.length; n.i = 0; t.css({width: n.max[0], height: o.first().outerheight(), overflow: hidden}); s.css({position: relative, left: 0, width: u * 100 + %}); o.css({float: left, width: n.max[0] + px}); i.autoplay && settimeout(function () { if (i.delay | 0) { n.play(); if (i.pause) { t.on(mouseover mouseout, function (e) { n.stop(); e.type == mouseout && n.play() }) } } }, i.init | 0); if (i.keys) { e(document).keydown(function (e) { var t = e.which; if (t == 37)n.prev(); else if (t == 39)n.next(); else if (t == 27)n.stop() }) } i.dots && r(dot); i.arrows && r(arrow); if (i.fluid) { e(window).resize(function () { n.r && cleartimeout(n.r); n.r = settimeout(function () { var e = {height: o.eq(n.i).outerheight()}, r = t.outerwidth(); s.css(e); e[width] = math.min(math.round(r / t.parent().width() * 100), 100) + %; t.css(e) }, 50) }).resize() } if (e.event.special[swipe] || e.event(swipe)) { t.on(swipeleft swiperight swipeleft swiperight, function (e) { e.type.tolowercase() == swipeleft ? n.next() : n.prev() }) } return n }; n.to = function (r, i) { if (n.t) { n.stop(); n.play() } var s = n.o, o = n.el, u = n.ul, a = n.li, l = n.i, c = a.eq(r); e.isfunction(s.starting) && !i && s.starting(o, a.eq(l)); if ((!c.length || r ' + n.o.next +
} n.el.addclass(has- + t + s).append(r).find(. + t).click(function () { var t = e(this); t.hasclass(dot) ? n.stop().to(t.index()) : t.hasclass(prev) ? n.prev() : n.next() }) } var n = this; n.o = { speed: 500, delay: 3e3, init: 0, pause: !t, loop: !t, keys: t, dots: t, arrows: t, prev: ←, next: →, fluid: t, starting: t, complete: t, items: >ul, item: >li, easing: swing, autoplay: true }; n.init = function (t, i) { n.o = e.extend(n.o, i); n.el = t; n.ul = t.find(n.o.items); n.max = [t.outerwidth() | 0, t.outerheight() | 0]; n.li = n.ul.find(n.o.item).each(function (t) { var r = e(this), i = r.outerwidth(), s = r.outerheight(); if (i > n.max[0])n.max[0] = i; if (s > n.max[1])n.max[1] = s }); var i = n.o, s = n.ul, o = n.li, u = o.length; n.i = 0; t.css({width: n.max[0], height: o.first().outerheight(), overflow: hidden}); s.css({position: relative, left: 0, width: u * 100 + %}); o.css({float: left, width: n.max[0] + px}); i.autoplay && settimeout(function () { if (i.delay | 0) { n.play(); if (i.pause) { t.on(mouseover mouseout, function (e) { n.stop(); e.type == mouseout && n.play() }) } } }, i.init | 0); if (i.keys) { e(document).keydown(function (e) { var t = e.which; if (t == 37)n.prev(); else if (t == 39)n.next(); else if (t == 27)n.stop() }) } i.dots && r(dot); i.arrows && r(arrow); if (i.fluid) { e(window).resize(function () { n.r && cleartimeout(n.r); n.r = settimeout(function () { var e = {height: o.eq(n.i).outerheight()}, r = t.outerwidth(); s.css(e); e[width] = math.min(math.round(r / t.parent().width() * 100), 100) + %; t.css(e) }, 50) }).resize() } if (e.event.special[swipe] || e.event(swipe)) { t.on(swipeleft swiperight swipeleft swiperight, function (e) { e.type.tolowercase() == swipeleft ? n.next() : n.prev() }) } return n }; n.to = function (r, i) { if (n.t) { n.stop(); n.play() } var s = n.o, o = n.el, u = n.ul, a = n.li, l = n.i, c = a.eq(r); e.isfunction(s.starting) && !i && s.starting(o, a.eq(l)); if ((!c.length || r < 0) && s.loop == t)return; if (!c.length)r = 0; if (r 1 ? - + ++i : ), a = (new n).init(s, t); s.data(u, a).data(key, u) }) }; n.version = 1.0.0})(jquery, false)这个脚本我要怎么修改


if (!c.length)r = 0;if (r < 0)r = a.length - 1;

if (!c.length) {r = 0; i = true;}if (r < 0) {r = a.length - 1; i = true;} // 此行是控制右往左轮播到边缘的, 可以不改
其它类似信息

推荐信息