/*! * superslide v2.1.1 * 轻松解决网站大部分特效展示问题 * 详尽信息请看官网:http://www.superslide2.com/ * * copyright 2011-2013, 大话主席 * * 请尊重原创,保留头部版权 * 在保留版权的前提下可应用于个人或商业用途 * v2.1.1:修复当调用多个superslide,并设置returndefault:true 时返回defaultindex索引错误 */ /*intertime:后边的数字是时间*/ !function(a) { a.fn.slide = function(b) { return a.fn.slide.defaults = { type: "slide", effect: "fade", autoplay: !1, delaytime: 500, intertime: 3000, triggertime: 150, defaultindex: 0, titcell: ".hd li", maincell: ".bd", targetcell: null, trigger: "mouseover", scroll: 1, vis: 1, titonclassname: "on", autopage: !1, prevcell: ".prev", nextcell: ".next", pagestatecell: ".pagestate", opp: !1, pnloop: !0, easing: "swing", startfun: null, endfun: null, switchload: null, playstatecell: ".playstate", mouseoverstop: !0, defaultplay: !0, returndefault: !1 }, this.each(function() { var c = a.extend({}, a.fn.slide.defaults, b) , d = a(this) , e = c.effect , f = a(c.prevcell, d) , g = a(c.nextcell, d) , h = a(c.pagestatecell, d) , i = a(c.playstatecell, d) , j = a(c.titcell, d) , k = j.size() , l = a(c.maincell, d) , m = l.children().size() , n = c.switchload , o = a(c.targetcell, d) , p = parseint(c.defaultindex) , q = parseint(c.delaytime) , r = parseint(c.intertime); parseint(c.triggertime); var q, t = parseint(c.scroll), u = parseint(c.vis), v = "false" == c.autoplay || 0 == c.autoplay ? !1 : !0, w = "false" == c.opp || 0 == c.opp ? !1 : !0, x = "false" == c.autopage || 0 == c.autopage ? !1 : !0, y = "false" == c.pnloop || 0 == c.pnloop ? !1 : !0, z = "false" == c.mouseoverstop || 0 == c.mouseoverstop ? !1 : !0, a = "false" == c.defaultplay || 0 == c.defaultplay ? !1 : !0, b = "false" == c.returndefault || 0 == c.returndefault ? !1 : !0, c = 0, d = 0, e = 0, f = 0, g = c.easing, h = null, i = null, j = null, k = c.titonclassname, l = j.index(d.find("." + k)), m = p = -1 == l ? p : l, n = p, o = p, p = m >= u ? 0 != m % t ? m % t : t : 0, r = "leftmarquee" == e || "topmarquee" == e ? !0 : !1, s = function() { a.isfunction(c.startfun) && c.startfun(p, k, d, a(c.titcell, d), l, o, f, g) }, t = function() { a.isfunction(c.endfun) && c.endfun(p, k, d, a(c.titcell, d), l, o, f, g) }, u = function() { j.removeclass(k), a && j.eq(n).addclass(k) }; if ("menu" == c.type) return a && j.removeclass(k).eq(p).addclass(k), j.hover(function() { q = a(this).find(c.targetcell); var b = j.index(a(this)); i = settimeout(function() { switch (p = b, j.removeclass(k).eq(p).addclass(k), s(), e) { case "fade": q.stop(!0, !0).animate({ opacity: "show" }, q, g, t); break; case "slidedown": q.stop(!0, !0).animate({ height: "show" }, q, g, t) } }, c.triggertime) }, function() { switch (cleartimeout(i), e) { case "fade": q.animate({ opacity: "hide" }, q, g); break; case "slidedown": q.animate({ height: "hide" }, q, g) } }), b && d.hover(function() { cleartimeout(j) }, function() { j = settimeout(u, q) }), void 0; if (0 == k && (k = m), r && (k = 2), x) { if (m >= u) if ("leftloop" == e || "toploop" == e) k = 0 != m % t ? (0 ^ m / t) + 1 : m / t; else { var v = m - u; k = 1 + parseint(0 != v % t ? v / t + 1 : v / t), 0 >= k && (k = 1) } else k = 1; j.html(""); var w = ""; if (1 == c.autopage || "true" == c.autopage) for (var x = 0; k > x; x++) w += "
  • " + (x + 1) + "
  • "; else for (var x = 0; k > x; x++) w += c.autopage.replace("$", x + 1); j.html(w); var j = j.children() } if (m >= u) { l.children().each(function() { a(this).width() > e && (e = a(this).width(), d = a(this).outerwidth(!0)), a(this).height() > f && (f = a(this).height(), c = a(this).outerheight(!0)) }); var y = l.children() , z = function() { for (var a = 0; u > a; a++) y.eq(a).clone().addclass("clone").appendto(l); for (var a = 0; p > a; a++) y.eq(m - a - 1).clone().addclass("clone").prependto(l) }; switch (e) { case "fold": l.css({ position: "relative", width: d, height: c }).children().css({ position: "absolute", width: e, left: 0, top: 0, display: "none" }); break; case "top": l.wrap('
    ').css({ top: -(p * t) * c, position: "relative", padding: "0", margin: "0" }).children().css({ height: f }); break; case "left": l.wrap('
    ').css({ width: m * d, left: -(p * t) * d, position: "relative", overflow: "hidden", padding: "0", margin: "0" }).children().css({ "float": "left", width: e }); break; case "leftloop": case "leftmarquee": z(), l.wrap('
    ').css({ width: (m + u + p) * d, position: "relative", overflow: "hidden", padding: "0", margin: "0", left: -(p + p * t) * d }).children().css({ "float": "left", width: e }); break; case "toploop": case "topmarquee": z(), l.wrap('
    ').css({ height: (m + u + p) * c, position: "relative", padding: "0", margin: "0", top: -(p + p * t) * c }).children().css({ height: f }) } } var $ = function(a) { var b = a * t; return a == k ? b = m : -1 == a && 0 != m % t && (b = -m % t), b } , _ = function(b) { var c = function(c) { for (var d = c; u + c > d; d++) b.eq(d).find("img[" + n + "]").each(function() { var b = a(this); if (b.attr("src", b.attr(n)).removeattr(n), l.find(".clone")[0]) for (var c = l.children(), d = 0; d < c.size(); d++) c.eq(d).find("img[" + n + "]").each(function() { a(this).attr(n) == b.attr("src") && a(this).attr("src", a(this).attr(n)).removeattr(n) }) }) }; switch (e) { case "fade": case "fold": case "top": case "left": case "slidedown": c(p * t); break; case "leftloop": case "toploop": c(p + $(o)); break; case "leftmarquee": case "topmarquee": var d = "leftmarquee" == e ? l.css("left").replace("px", "") : l.css("top").replace("px", "") , f = "leftmarquee" == e ? d : c , g = p; if (0 != d % f) { var h = math.abs(0 ^ d / f); g = 1 == p ? p + h : p + h - 1 } c(g) } } , ab = function(a) { if (!a || m != p || a || r) { if (r ? p >= 1 ? p = 1 : 0 >= p && (p = 0) : (o = p, p >= k ? p = 0 : 0 > p && (p = k - 1)), s(), null != n && _(l.children()), o[0] && (q = o.eq(p), null != n && _(o), "slidedown" == e ? (o.not(q).stop(!0, !0).slideup(q), q.slidedown(q, g, function() { l[0] || t() })) : (o.not(q).stop(!0, !0).hide(), q.animate({ opacity: "show" }, q, function() { l[0] || t() }))), m >= u) switch (e) { case "fade": l.children().stop(!0, !0).eq(p).animate({ opacity: "show" }, q, g, function() { t() }).siblings().hide(); break; case "fold": l.children().stop(!0, !0).eq(p).animate({ opacity: "show" }, q, g, function() { t() }).siblings().animate({ opacity: "hide" }, q, g); break; case "top": l.stop(!0, !1).animate({ top: -p * t * c }, q, g, function() { t() }); break; case "left": l.stop(!0, !1).animate({ left: -p * t * d }, q, g, function() { t() }); break; case "leftloop": var b = o; l.stop(!0, !0).animate({ left: -($(o) + p) * d }, q, g, function() { -1 >= b ? l.css("left", -(p + (k - 1) * t) * d) : b >= k && l.css("left", -p * d), t() }); break; case "toploop": var b = o; l.stop(!0, !0).animate({ top: -($(o) + p) * c }, q, g, function() { -1 >= b ? l.css("top", -(p + (k - 1) * t) * c) : b >= k && l.css("top", -p * c), t() }); break; case "leftmarquee": var c = l.css("left").replace("px", ""); 0 == p ? l.animate({ left: ++c }, 0, function() { l.css("left").replace("px", "") >= 0 && l.css("left", -m * d) }) : l.animate({ left: --c }, 0, function() { l.css("left").replace("px", "") <= -(m + p) * d && l.css("left", -p * d) }); break; case "topmarquee": var d = l.css("top").replace("px", ""); 0 == p ? l.animate({ top: ++d }, 0, function() { l.css("top").replace("px", "") >= 0 && l.css("top", -m * c) }) : l.animate({ top: --d }, 0, function() { l.css("top").replace("px", "") <= -(m + p) * c && l.css("top", -p * c) }) } j.removeclass(k).eq(p).addclass(k), m = p, y || (g.removeclass("nextstop"), f.removeclass("prevstop"), 0 == p && f.addclass("prevstop"), p == k - 1 && g.addclass("nextstop")), h.html("" + (p + 1) + "/" + k) } }; a && ab(!0), b && d.hover(function() { cleartimeout(j) }, function() { j = settimeout(function() { p = n, a ? ab() : "slidedown" == e ? q.slideup(q, u) : q.animate({ opacity: "hide" }, q, u), m = p }, 300) }); var bb = function(a) { h = setinterval(function() { w ? p-- : p++, ab() }, a ? a : r) } , cb = function(a) { h = setinterval(ab, a ? a : r) } , db = function() { z || (clearinterval(h), bb()) } , eb = function() { (y || p != k - 1) && (p++, ab(), r || db()) } , fb = function() { (y || 0 != p) && (p--, ab(), r || db()) } , gb = function() { clearinterval(h), r ? cb() : bb(), i.removeclass("pausestate") } , hb = function() { clearinterval(h), i.addclass("pausestate") }; if (v ? r ? (w ? p-- : p++, cb(), z && l.hover(hb, gb)) : (bb(), z && d.hover(hb, gb)) : (r && (w ? p-- : p++), i.addclass("pausestate")), i.click(function() { i.hasclass("pausestate") ? gb() : hb() }), "mouseover" == c.trigger ? j.hover(function() { var a = j.index(this); i = settimeout(function() { p = a, ab(), db() }, c.triggertime) }, function() { cleartimeout(i) }) : j.click(function() { p = j.index(this), ab(), db() }), r) { if (g.mousedown(eb), f.mousedown(fb), y) { var ib, jb = function() { ib = settimeout(function() { clearinterval(h), cb(0 ^ r / 10) }, 150) }, kb = function() { cleartimeout(ib), clearinterval(h), cb() }; g.mousedown(jb), g.mouseup(kb), f.mousedown(jb), f.mouseup(kb) } "mouseover" == c.trigger && (g.hover(eb, function() {}), f.hover(fb, function() {})) } else g.click(eb), f.click(fb) }) } }(jquery), jquery.easing.jswing = jquery.easing.swing, jquery.extend(jquery.easing, { def: "easeoutquad", swing: function(a, b, c, d, e) { return jquery.easing[jquery.easing.def](a, b, c, d, e) }, easeinquad: function(a, b, c, d, e) { return d * (b /= e) * b + c }, easeoutquad: function(a, b, c, d, e) { return -d * (b /= e) * (b - 2) + c }, easeinoutquad: function(a, b, c, d, e) { return (b /= e / 2) < 1 ? d / 2 * b * b + c : -d / 2 * (--b * (b - 2) - 1) + c }, easeincubic: function(a, b, c, d, e) { return d * (b /= e) * b * b + c }, easeoutcubic: function(a, b, c, d, e) { return d * ((b = b / e - 1) * b * b + 1) + c }, easeinoutcubic: function(a, b, c, d, e) { return (b /= e / 2) < 1 ? d / 2 * b * b * b + c : d / 2 * ((b -= 2) * b * b + 2) + c }, easeinquart: function(a, b, c, d, e) { return d * (b /= e) * b * b * b + c }, easeoutquart: function(a, b, c, d, e) { return -d * ((b = b / e - 1) * b * b * b - 1) + c }, easeinoutquart: function(a, b, c, d, e) { return (b /= e / 2) < 1 ? d / 2 * b * b * b * b + c : -d / 2 * ((b -= 2) * b * b * b - 2) + c }, easeinquint: function(a, b, c, d, e) { return d * (b /= e) * b * b * b * b + c }, easeoutquint: function(a, b, c, d, e) { return d * ((b = b / e - 1) * b * b * b * b + 1) + c }, easeinoutquint: function(a, b, c, d, e) { return (b /= e / 2) < 1 ? d / 2 * b * b * b * b * b + c : d / 2 * ((b -= 2) * b * b * b * b + 2) + c }, easeinsine: function(a, b, c, d, e) { return -d * math.cos(b / e * (math.pi / 2)) + d + c }, easeoutsine: function(a, b, c, d, e) { return d * math.sin(b / e * (math.pi / 2)) + c }, easeinoutsine: function(a, b, c, d, e) { return -d / 2 * (math.cos(math.pi * b / e) - 1) + c }, easeinexpo: function(a, b, c, d, e) { return 0 == b ? c : d * math.pow(2, 10 * (b / e - 1)) + c }, easeoutexpo: function(a, b, c, d, e) { return b == e ? c + d : d * (-math.pow(2, -10 * b / e) + 1) + c }, easeinoutexpo: function(a, b, c, d, e) { return 0 == b ? c : b == e ? c + d : (b /= e / 2) < 1 ? d / 2 * math.pow(2, 10 * (b - 1)) + c : d / 2 * (-math.pow(2, -10 * --b) + 2) + c }, easeincirc: function(a, b, c, d, e) { return -d * (math.sqrt(1 - (b /= e) * b) - 1) + c }, easeoutcirc: function(a, b, c, d, e) { return d * math.sqrt(1 - (b = b / e - 1) * b) + c }, easeinoutcirc: function(a, b, c, d, e) { return (b /= e / 2) < 1 ? -d / 2 * (math.sqrt(1 - b * b) - 1) + c : d / 2 * (math.sqrt(1 - (b -= 2) * b) + 1) + c }, easeinelastic: function(a, b, c, d, e) { var f = 1.70158 , g = 0 , h = d; if (0 == b) return c; if (1 == (b /= e)) return c + d; if (g || (g = .3 * e), h < math.abs(d)) { h = d; var f = g / 4 } else var f = g / (2 * math.pi) * math.asin(d / h); return -(h * math.pow(2, 10 * (b -= 1)) * math.sin((b * e - f) * 2 * math.pi / g)) + c }, easeoutelastic: function(a, b, c, d, e) { var f = 1.70158 , g = 0 , h = d; if (0 == b) return c; if (1 == (b /= e)) return c + d; if (g || (g = .3 * e), h < math.abs(d)) { h = d; var f = g / 4 } else var f = g / (2 * math.pi) * math.asin(d / h); return h * math.pow(2, -10 * b) * math.sin((b * e - f) * 2 * math.pi / g) + d + c }, easeinoutelastic: function(a, b, c, d, e) { var f = 1.70158 , g = 0 , h = d; if (0 == b) return c; if (2 == (b /= e / 2)) return c + d; if (g || (g = e * .3 * 1.5), h < math.abs(d)) { h = d; var f = g / 4 } else var f = g / (2 * math.pi) * math.asin(d / h); return 1 > b ? -.5 * h * math.pow(2, 10 * (b -= 1)) * math.sin((b * e - f) * 2 * math.pi / g) + c : .5 * h * math.pow(2, -10 * (b -= 1)) * math.sin((b * e - f) * 2 * math.pi / g) + d + c }, easeinback: function(a, b, c, d, e, f) { return void 0 == f && (f = 1.70158), d * (b /= e) * b * ((f + 1) * b - f) + c }, easeoutback: function(a, b, c, d, e, f) { return void 0 == f && (f = 1.70158), d * ((b = b / e - 1) * b * ((f + 1) * b + f) + 1) + c }, easeinoutback: function(a, b, c, d, e, f) { return void 0 == f && (f = 1.70158), (b /= e / 2) < 1 ? d / 2 * b * b * (((f *= 1.525) + 1) * b - f) + c : d / 2 * ((b -= 2) * b * (((f *= 1.525) + 1) * b + f) + 2) + c }, easeinbounce: function(a, b, c, d, e) { return d - jquery.easing.easeoutbounce(a, e - b, 0, d, e) + c }, easeoutbounce: function(a, b, c, d, e) { return (b /= e) < 1 / 2.75 ? d * 7.5625 * b * b + c : 2 / 2.75 > b ? d * (7.5625 * (b -= 1.5 / 2.75) * b + .75) + c : 2.5 / 2.75 > b ? d * (7.5625 * (b -= 2.25 / 2.75) * b + .9375) + c : d * (7.5625 * (b -= 2.625 / 2.75) * b + .984375) + c }, easeinoutbounce: function(a, b, c, d, e) { return e / 2 > b ? .5 * jquery.easing.easeinbounce(a, 2 * b, 0, d, e) + c : .5 * jquery.easing.easeoutbounce(a, 2 * b - e, 0, d, e) + .5 * d + c } });