请登录
玩家共建非官方战双WIKI,做最还原游戏内UI体验的WIKI!    
战双WIKI反馈留言板 · WIKI编辑教程 · BWIKI收藏到桌面的方法说明

全站通知:

Widget:Test9

来自战双帕弥什WIKI_BWIKI_哔哩哔哩
跳到导航 跳到搜索

<script>(window.RLQ = window.RLQ || []).push(['jquery', () => {

//轮播图插件 ! function (a) { a.fn.slide = function (b) { return a.fn.slide.defaults = { type: "slide", effect: "fade", autoPlay: !1, delayTime: 500, interTime: 2500, 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 t, u, v, w, x, y, z, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, $, _, ab, bb, cb, db, eb, fb, gb, hb, ib, jb, kb, lb, mb, nb, 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.length, l = a(c.mainCell, d), m = l.children().length, n = c.switchLoad, o = a(c.targetCell, d), p = parseInt(c.defaultIndex), q = parseInt(c.delayTime), r = parseInt(c.interTime); if (parseInt(c.triggerTime), t = parseInt(c.scroll), u = "false" == c.autoPlay || 0 == c.autoPlay ? !1 : !0, v = "false" == c.opp || 0 == c.opp ? !1 : !0, w = "false" == c.autoPage || 0 == c.autoPage ? !1 : !0, x = "false" == c.pnLoop || 0 == c.pnLoop ? !1 : !0, y = "false" == c.mouseOverStop || 0 == c.mouseOverStop ? !1 : !0, z = "false" == c.defaultPlay || 0 == c.defaultPlay ? !1 : !0, A = "false" == c.returnDefault || 0 == c.returnDefault ? !1 : !0, B = isNaN(c.vis) ? 1 : parseInt(c.vis), C = !-[1] && !window.XMLHttpRequest, D = 0, E = 0, F = 0, G = 0, H = c.easing, I = null, J = null, K = null, L = c.titOnClassName, M = j.index(d.find("." + L)), N = p = -1 == M ? p : M, O = p, P = p, Q = m >= B ? 0 != m % t ? m % t : t : 0, S = "leftMarquee" == e || "topMarquee" == e ? !0 : !1, T = function () { a.isFunction(c.startFun) && c.startFun(p, k, d, a(c.titCell, d), l, o, f, g) }, U = function () { a.isFunction(c.endFun) && c.endFun(p, k, d, a(c.titCell, d), l, o, f, g) }, V = function () { j.removeClass(L), z && j.eq(O).addClass(L) }, "menu" == c.type) return z && j.removeClass(L).eq(p).addClass(L), j.hover(function () { R = a(this).find(c.targetCell); var b = j.index(a(this)); J = setTimeout(function () { switch (p = b, j.removeClass(L).eq(p).addClass(L), T(), e) { case "fade": R.stop(!0, !0).animate({ opacity: "show" }, q, H, U); break; case "slideDown": R.stop(!0, !0).animate({ height: "show" }, q, H, U) } }, c.triggerTime) }, function () { switch (clearTimeout(J), e) { case "fade": R.animate({ opacity: "hide" }, q, H); break; case "slideDown": R.animate({ height: "hide" }, q, H) } }), A && d.hover(function () { clearTimeout(K) }, function () { K = setTimeout(V, q) }), void 0; if (0 == k && (k = m), S && (k = 2), w) { if (m >= B ? "leftLoop" == e || "topLoop" == e ? k = 0 != m % t ? (0 ^ m / t) + 1 : m / t : (W = m - B, k = 1 + parseInt(0 != W % t ? W / t + 1 : W / t), 0 >= k && (k = 1)) : k = 1, j.html(""), X = "", 1 == c.autoPage || "true" == c.autoPage)

for (Y = 0; k > Y; Y++) X += "

  • " + (Y + 1) + "
  • "; else for (Y = 0; k > Y; Y++) X += c.autoPage.replace("$", Y + 1); j.html(X), j = j.children() } if (m >= B) switch (l.children().each(function () { a(this).width() > F && (F = a(this).width(), E = a(this).outerWidth(!0)), a(this).height() > G && (G = a(this).height(), D = a(this).outerHeight(!0)) }), Z = l.children(), $ = function () { var a; for (a = 0; B > a; a++) Z.eq(a).clone().addClass("clone").appendTo(l); for (a = 0; Q > a; a++) Z.eq(m - a - 1).clone().addClass("clone").prependTo(l) }, e) { case "fold": l.css({ position: "relative", width: E, height: D }).children().css({ position: "absolute", width: F, left: 0, top: 0, display: "none" }); break; case "top": l.wrap('

    ').css({

    top: -(p * t) * D, position: "relative", padding: "0", margin: "0" }).children().css({ height: G }); break; case "left":

    l.wrap('

    ').css({

    width: m * E, left: -(p * t) * E, position: "relative", overflow: "hidden", padding: "0", margin: "0" }).children().css({ "float": "left", width: F }); break; case "leftLoop": case "leftMarquee":

    $(), l.wrap('

    ').css({

    width: (m + B + Q) * E, position: "relative", overflow: "hidden", padding: "0", margin: "0", left: -(Q + p * t) * E }).children().css({ "float": "left", width: F }); break; case "topLoop": case "topMarquee":

    $(), l.wrap('

    ').css({

    height: (m + B + Q) * D, position: "relative", padding: "0", margin: "0", top: -(Q + p * t) * D }).children().css({ height: G }) } _ = function (a) { var b = a * t; return a == k ? b = m : -1 == a && 0 != m % t && (b = -m % t), b }, ab = function (b) { var d, f, g, h, c = function (c) { for (var d = c; B + c > d; d++) b.eq(d).find("img[" + n + "]").each(function () { var c, d, b = a(this); if (b.attr("src", b.attr(n)).removeAttr(n), l.find(".clone")[0]) for (c = l.children(), d = 0; d < c.length; 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(Q + _(P)); break; case "leftMarquee": case "topMarquee": d = "leftMarquee" == e ? l.css("left").replace("px", "") : l.css("top").replace("px", ""), f = "leftMarquee" == e ? E : D, g = Q, 0 != d % f && (h = Math.abs(0 ^ d / f), g = 1 == p ? Q + h : Q + h - 1), c(g) } }, bb = function (a) { var b, c, d; if (!z || N != p || a || S) { if (S ? p >= 1 ? p = 1 : 0 >= p && (p = 0) : (P = p, p >= k ? p = 0 : 0 > p && (p = k - 1)), T(), null != n && ab(l.children()), o[0] && (R = o.eq(p), null != n && ab(o), "slideDown" == e ? (o.not(R).stop(!0, !0).slideUp(q), R.slideDown(q, H, function () { l[0] || U() })) : (o.not(R).stop(!0, !0).hide(), R.animate({ opacity: "show" }, q, function () { l[0] || U() }))), m >= B) switch (e) { case "fade": l.children().stop(!0, !0).eq(p).animate({ opacity: "show" }, q, H, function () { U() }).siblings().hide(); break; case "fold": l.children().stop(!0, !0).eq(p).animate({ opacity: "show" }, q, H, function () { U() }).siblings().animate({ opacity: "hide" }, q, H); break; case "top": l.stop(!0, !1).animate({ top: -p * t * D }, q, H, function () { U() }); break; case "left": l.stop(!0, !1).animate({ left: -p * t * E }, q, H, function () { U() }); break; case "leftLoop": b = P, l.stop(!0, !0).animate({ left: -(_(P) + Q) * E }, q, H, function () { -1 >= b ? l.css("left", -(Q + (k - 1) * t) * E) : b >= k && l.css("left", -Q * E), U() }); break; case "topLoop": b = P, l.stop(!0, !0).animate({ top: -(_(P) + Q) * D }, q, H, function () { -1 >= b ? l.css("top", -(Q + (k - 1) * t) * D) : b >= k && l.css("top", -Q * D), U() }); break; case "leftMarquee": c = l.css("left").replace("px", ""), 0 == p ? l.animate({ left: ++c }, 0, function () { l.css("left").replace("px", "") >= 0 && l.css("left", -m * E) }) : l.animate({ left: --c }, 0, function () { l.css("left").replace("px", "") <= -(m + Q) * E && l.css("left", -Q * E) }); break; case "topMarquee": d = l.css("top").replace("px", ""), 0 == p ? l.animate({ top: ++d }, 0, function () { l.css("top").replace("px", "") >= 0 && l.css("top", -m * D) }) : l.animate({ top: --d }, 0, function () { l.css("top").replace("px", "") <= -(m + Q) * D && l.css("top", -Q * D) }) } j.removeClass(L).eq(p).addClass(L), N = p, x || (g.removeClass("nextStop"), f.removeClass("prevStop"), 0 == p && f.addClass("prevStop"), p == k - 1 && g.addClass("nextStop")), h.html("" + (p + 1) + "/" + k) } }, z && bb(!0), A && d.hover(function () { clearTimeout(K) }, function () { K = setTimeout(function () { p = O, z ? bb() : "slideDown" == e ? R.slideUp(q, V) : R.animate({ opacity: "hide" }, q, V), N = p }, 300) }), cb = function (a) { I = setInterval(function () { v ? p-- : p++, bb() }, a ? a : r) }, db = function (a) { I = setInterval(bb, a ? a : r) }, eb = function () { y || !u || i.hasClass("pauseState") || (clearInterval(I), cb()) }, fb = function () { (x || p != k - 1) && (p++, bb(), S || eb()) }, gb = function () { (x || 0 != p) && (p--, bb(), S || eb()) }, hb = function () { clearInterval(I), S ? db() : cb(), i.removeClass("pauseState") }, ib = function () { clearInterval(I), i.addClass("pauseState") }, u ? S ? (v ? p-- : p++, db(), y && l.hover(ib, hb)) : (cb(), y && d.hover(ib, hb)) : (S && (v ? p-- : p++), i.addClass("pauseState")), i.click(function () { i.hasClass("pauseState") ? hb() : ib() }), "mouseover" == c.trigger ? j.hover(function () { var a = j.index(this); J = setTimeout(function () { p = a, bb(), eb() }, c.triggerTime) }, function () { clearTimeout(J) }) : j.click(function () { p = j.index(this), bb(), eb() }), S ? (g.mousedown(fb), f.mousedown(gb), x && (kb = function () { jb = setTimeout(function () { clearInterval(I), db(0 ^ r / 10) }, 150) }, lb = function () { clearTimeout(jb), clearInterval(I), db() }, g.mousedown(kb), g.mouseup(lb), f.mousedown(kb), f.mouseup(lb)), "mouseover" == c.trigger && (g.hover(fb, function () {}), f.hover(gb, function () {}))) : (g.click(fb), f.click(gb)), "auto" != c.vis || 1 != t || "left" != e && "leftLoop" != e || (nb = function () { C && (l.width("auto"), l.children().width("auto")), l.parent().width("auto"), E = l.parent().width(), C && l.parent().width(E), l.children().width(E), "left" == e ? (l.width(E * m), l.stop(!0, !1).animate({ left: -p * E }, 0)) : (l.width(E * (m + 2)), l.stop(!0, !1).animate({ left: -(p + 1) * E }, 0)), C || E == l.parent().width() || nb() }, a(window).resize(function () { clearTimeout(mb), mb = setTimeout(nb, 100) }), nb()) }) } }(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; return 0 == b ? c : 1 == (b /= e) ? c + d : (g || (g = .3 * e), h < Math.abs(d) ? (h = d, f = g / 4) : f = g / (2 * Math.PI) * Math.asin(d / h), -(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; return 0 == b ? c : 1 == (b /= e) ? c + d : (g || (g = .3 * e), h < Math.abs(d) ? (h = d, f = g / 4) : f = g / (2 * Math.PI) * Math.asin(d / h), 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; return 0 == b ? c : 2 == (b /= e / 2) ? c + d : (g || (g = e * .3 * 1.5), h < Math.abs(d) ? (h = d, f = g / 4) : f = g / (2 * Math.PI) * Math.asin(d / h), 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 } });

    //fsvs插件

    ( function($){

    $.fn.fsvs = function( options ) {

    options = options || {};

    var defaults = { speed : 5000, bodyID : 'fsvs-body', selector : '> .slide', mouseSwipeDisance : 40, afterSlide : function(){}, beforeSlide : function(){}, endSlide : function(){}, mouseWheelEvents : true, mouseWheelDelay : false, scrollabelArea : 'scrollable', mouseDragEvents : true, touchEvents : true, arrowKeyEvents : true, pagination : true, nthClasses : false, detectHash : true };

    for( var i in options ) { defaults[i] = options[i]; } options = defaults;

    /*** [currentSlideIndex description]* @type {Number}*/

    var currentSlideIndex = 0;

    /*** [ignoreHashChange description]* @type {Boolean}*/

    var ignoreHashChange = false;

    /*** [bodyTimeout description]* @type {[type]}*/

    var bodyTimeout = null;

    /*** [body description]* @type {[type]}*/

    var body = null;

    /*** [scrolling description]* @type {Boolean}*/

    var scrolling = false;

    /*** [mouseWheelTimer description]* @type {Boolean}*/

    var mouseWheelTimer = false;

    /*** [mouseWheelScrollStart description]* Indicates when the mouseWheel last invoked a slide event.* @type {Integer}*/

    var mouseWheelScrollStart = 0;

    /*** [pagination description]* @type {Boolean}*/

    var pagination = false;


    var isChrome = function() { var isChromium = window.chrome, vendorName = window.navigator.vendor; if( isChromium !== null && vendorName === "Google Inc." ) { return true; } return false; };

    var changeViaHash = function() { if( ! ignoreHashChange ) { if( window.location.hash !== ) { var slideID = window.location.hash; var slideTo = $( '> ' + slideID, body ); app.slideToIndex( slideTo.index() ); } } ignoreHashChange = false; };


    var detectHash = function(){ $( options.selector, body ).each( function( i ) { var slide = $(this); if( ! slide.attr( 'id' ) ) { slide.attr( 'id', 'slide-' + (i+1) ); } }); changeViaHash(); };


    var hasTransition = function(){ prefixes = ['Webkit','Moz','ms','O']; for( var i in prefixes ) { if( typeof document.getElementsByTagName( 'body' )[0].style[prefixes[i] + 'Transition' ] !== 'undefined' ) { return true; } } return false; }

    var bindMouseDrag = function() { var x, y; window.onmousedown = function(e) { y = e.y; } window.onmouseup = function(e) { if( e.y > ( y+options.mouseSwipeDisance ) ) { app.slideUp(); } else if( e.y < ( y-options.mouseSwipeDisance ) ) { app.slideDown(); } } };


    var unBindMouseDrag = function(){ window.onmousedown = function(){}; window.onmouseup = function(){}; }

    var bindTouchSwipe = function() { var startY = null; $(window).on( "touchstart.fsvs", function(ev) { var e = ev.originalEvent; var cancelOn = ['a','input','textarea','select']; if( $.inArray( e.target.nodeName.toLowerCase(), cancelOn ) == -1 ) { var touches = e.touches; if( touches && touches.length ) { startY = touches[0].pageY; } e.preventDefault(); } }); $(window).on( "touchmove.fsvs", function(ev) { var e = ev.originalEvent; if( startY !== null ) { var touches = e.touches; if( touches && touches.length ) { var deltaY = startY - touches[0].pageY; if ( deltaY >= options.mouseSwipeDisance ) { app.slideDown(); startY = null; } if ( deltaY <= ( options.mouseSwipeDisance * -1 ) ) { app.slideUp(); startY = null; } } e.preventDefault(); } }); }; var unbindTouchSwipe = function() { $(window).unbind( "touchstart.fsvs" ); $(window).unbind( "touchmove.fsvs" ); };


    var mouseWheelHandler = function( ev ) { var e = window.event || ev; var wheely = ( e.wheelDelta || -e.detail || e.originalEvent.detail ); var delta = Math.max( -1, Math.min( 1, wheely ) ); if( isChrome() ) { wheely = Math.floor( wheely / 5 ); } if( ( ! scrolling || ( options.mouseWheelDelay && Date.now() > mouseWheelScrollStart + options.mouseWheelDelay ) ) && Math.abs( wheely ) > 5 ) { mouseWheelScrollStart = Date.now(); scrolling = true; var allowToRun = true; var target = $(ev.target); if( target.hasClass( options.scrollabelArea ) || target.parents( '.' + options.scrollabelArea ).length !== 0 ) { allowToRun = false; var scrollableArea = target.closest('.' + options.scrollabelArea); if( target.hasClass( options.scrollabelArea ) ) scrollableArea = target; if( isScrollingUp(ev) && scrollableArea.scrollTop() === 0 ) { allowToRun = true; } else if( scrollableArea[0].scrollHeight - scrollableArea.scrollTop() === scrollableArea.outerHeight() ) { allowToRun = true; } } if( allowToRun ) { if( isScrollingUp(ev) ) { app.slideUp(); } else { app.slideDown(); } } else { scrolling = false; } } };

    var isScrollingUp = function(ev){ var e = window.event || ev; var wheely = ( e.wheelDelta || -e.detail || e.originalEvent.detail ); var delta = Math.max( -1, Math.min( 1, wheely ) ); if( isChrome() ) wheely = Math.floor( wheely / 5 ); if( e.originalEvent && e.originalEvent.detail ) { if( delta > 0 ) { return false; } } else if( delta < 0 ) { return false; } return true; }


    var bindMouseWheelEvent = function() { $(window).bind('wheel.fsvs mousewheel.fsvs DOMMouseScroll.fsvs MozMousePixelScroll.fsvs', mouseWheelHandler ); };


    var unBindMouseWheelEvent = function(){ $(window).unbind('wheel.fsvs mousewheel.fsvs DOMMouseScroll.fsvs MozMousePixelScroll.fsvs', mouseWheelHandler ); };


    var bindKeyArrows = function() { allow = true; $('input,textarea,select,option', body) .bind( 'focus.fsvs', function(){ allow = false; }) .bind( 'blur.fsvs', function(){ allow = true; }); window.onkeydown = function(e) { e = e || window.event; if ( e.keyCode == '38' && allow ) app.slideUp(); else if ( e.keyCode == '40' && allow ) app.slideDown(); } };


    var unbindKeyArrows = function(){ $('input,textarea,select,option', body).unbind('focus.fsvs blur.fsvs'); window.onkeydown = function(){}; };


    var slideCallback = function( index ) { currentSlideIndex = index; options.afterSlide( index ); if( options.detectHash ) { var slide = $( options.selector, body ).eq( index ); window.location.hash = slide[0].id; } if( ! app.canSlideDown() ) { options.endSlide( index ); } scrolling = false; };

    var nthClasses = function( nthClassLimit ) { $( options.selector, body ).each( function( i ) { var nthClass = 'nth-class-' + ((i%nthClassLimit)+1); if( ! $(this).hasClass( nthClass ) ) { $(this).addClass( nthClass ); } }); };


    var jQuerySlide = function( index ) { options.beforeSlide( index ); if( body.is( ':animated' ) ) { currentSlideIndex = index; body.stop(); } body.animate({ top : '-' + (index*$(window).height()) + 'px' }, options.speed, function() { slideCallback( index ); }); };

    /* ** @param {[type]} index [description] @return {[type]} [description]*/

    var cssSlide = function( index ) { options.beforeSlide( index ); body.css({ '-webkit-transform' : 'translate3d(0, -' + (index*100) + '%, 0)', '-moz-transform' : 'translate3d(0, -' + (index*100) + '%, 0)', '-ms-transform' : 'translate3d(0, -' + (index*100) + '%, 0)', 'transform' : 'translate3d(0, -' + (index*100) + '%, 0)' }); if( bodyTimeout !== null ) { currentSlideIndex = index; clearTimeout( bodyTimeout ); } bodyTimeout = setTimeout( function(){ slideCallback( index ); bodyTimeout = null; }, options.speed ); }


    var removeStyling = function(){ body.attr('style', ); $('> div', body).each(function(i){ $(this).attr('class', 'slide' ); }); $('body').attr('class',); $('#fsvs-pagination').remove(); };

    var app = {

    nthClasses : nthClasses,


    addPagination : function() {

    pagination = $('

      ');

      $( options.selector, body ).each( function(i) { var linkClass = currentSlideIndex === i ? 'pagination-link active' : 'pagination-link';

      $('

    • ').appendTo( pagination ); }); if( $('#navpathon').length !== 0 ) { $('#fsvs-navpathon').remove(); } pagination.appendTo( $('body') ); var paginationHeight = pagination.height(); var speed = options.speed/1000; $('span', pagination).css({ '-webkit-transition': 'all ' + speed + 's', '-moz-transition' : 'all ' + speed + 's', '-o-transition' : 'all ' + speed + 's', 'transition' : 'all ' + speed + 's' }); pagination.css({ marginTop : '-' + (paginationHeight/2) + 'px', right : '25px' }); $('li', pagination).bind( 'click.fsvs', function(e){ ignoreHashChange = true; $('.active', pagination).removeClass( 'active' ); $(this).addClass( 'active' ); app.slideToIndex( $(this).index(), e ); }); }, setSpeed : function( _speed ) { speed = _speed/1000; body.css({ '-webkit-transition': 'all ' + speed + 's', '-moz-transition' : 'all ' + speed + 's', '-o-transition' : 'all ' + speed + 's', 'transition' : 'all ' + speed + 's' }); }, shouldRun : function() { return $('html').hasClass( 'fsvs' ); }, canSlideUp : function() { if( currentSlideIndex === 0 ) return false; return true; }, canSlideDown : function() { if( $( options.selector, body ).eq( (currentSlideIndex+1) ).length === 0 ) return false; return true; }, addClasses : function( before, after ) { var _body = $('body'); _body.removeClass( removeClass = 'active-slide-' + (before+1) ); _body.addClass( 'active-slide-' + (after+1) ); $( options.selector, body ).eq( before ).removeClass( 'active-slide' ); $( options.selector, body ).eq( after ).addClass( 'active-slide' ); if( options.nthClasses ) { _body.removeClass( 'active-nth-slide-' + (( before % options.nthClasses )+1) ); _body.addClass( 'active-nth-slide-' + (( after % options.nthClasses )+1) ); } }, slideToIndex : function( index, e ) { var e = e || false; if( ! e && pagination ) { $('.active', pagination).removeClass( 'active' ); $('> *', pagination).eq(index).addClass( 'active' ); } app.addClasses( currentSlideIndex, index ); if( hasTransition() ) { cssSlide( index ); } else { jQuerySlide( index ); } }, unbind : function(){ unBindMouseDrag(); unBindMouseWheelEvent(); unbindKeyArrows(); unbindTouchSwipe(); removeStyling(); $('html').removeClass('fsvs'); }, rebind : function() { $('html').addClass('fsvs'); app.init(); }, slideDown : function(e) { if( app.canSlideDown() ) { ignoreHashChange = true; app.slideToIndex( (currentSlideIndex+1), e ); } else { scrolling = false; } }, slideUp : function(e) { if( app.canSlideUp() ) { ignoreHashChange = true; app.slideToIndex( (currentSlideIndex-1), e ); } else { scrolling = false; } }, init : function() { body = $( '#' + options.bodyID ); if( hasTransition() ) { app.setSpeed( options.speed ); } if( options.pagination ) { app.addPagination(); } if( options.nthClasses ) { nthClasses( options.nthClasses ); } if( options.mouseWheelEvents ) { bindMouseWheelEvent(); } if( options.arrowKeyEvents ) { bindKeyArrows(); } if( options.mouseDragEvents ) { bindMouseDrag(); } if( options.touchEvents ) { bindTouchSwipe(); } if( options.detectHash ) { detectHash(); if( window.addEventListener ) { window.addEventListener( "hashchange", changeViaHash, false ); } else if (window.attachEvent) { window.attachEvent( "onhashchange", changeViaHash ); } $('body').attr('class', ' '); } app.addClasses( 0, 0 ); } }; if( app.shouldRun() ) { app.init(); } return app; }; })( jQuery ); /* 导航条js */ $(function () { $('.sidenav').find('label').click(function(){ $('.sidenav').children('.side').slideToggle(); }) //PC端鼠标浮动展示子导航 $(".nav>ul>li").each(function () { //如果没有子目录,则删除包含子目录的div if ($(this).children('.s_navbox').children('.s_a').find('a').length<1) { $(this).children('.s_navbox').remove() } //设置伸缩和展开的样式 else{ $(this).mouseover( function (){ $(this).children().next('.s_navbox').stop(true, true).delay(100).slideDown(200); }) $(this).mouseleave( function (){$(this).children().next('.s_navbox').stop(true, true).delay(100).slideUp(100);}) } }); //点击逐渐展开移动端导航 $(".a_js").click( function () { $(".m_nav").stop(true, false).delay(0).animate({ width: "100%", height: "100%" }, 0); $(".m_nav").find(".closecover").stop(true, false).delay(0).animate({ opacity: "0.9" }, 300); $(".m_nav").find(".closeicon").stop(true, false).delay(0).animate({ opacity: "1" }, 300); $(".m_nav").find(".m_navList").stop(true, false).delay(0).animate({ right: "0" }, 300); $('body').css('overflow','hidden'); } ) //点击关闭,逐渐隐藏 $(".a_closed").click( function () { $(".m_nav").stop(true, false).delay(300).animate({ width: "0", height: "0" }, 0); $(".m_nav").find(".closecover").stop(true, false).delay(0).animate({ opacity: "0" }, 300); $(".m_nav").find(".closeicon").stop(true, false).delay(0).animate({ opacity: "0" }, 300); $(".m_nav").find(".m_navList").stop(true, false).delay(0).animate({ right: "-80%" }, 300); $('body').css('overflow','auto'); } ) //判断是否有子标题 $('.m_navList ul li').each(function () { $(this).children('.m_f_a').find('i').addClass('icon') if ($(this).children('.m_s_nav').find('a').length < 1) { $(this).children('.m_f_a').children('i').removeClass('icon'); } }); //点击图标展开关闭子导航 $('.m_navList ul li').find('.m_f_a i').click(function () { $(this).parent().parent().siblings().children('.m_s_nav').slideUp(); $(this).parent().parent().siblings().children('.m_f_a').find('i').removeClass('icon_on') $(this).parent().next().toggle("normal").prev().children('i').toggleClass('icon_on'); }) }); // 侧边栏js $(function () { var a = $("section"); //获取每个大块的元素 var b = []; for (i = 0; i < a.length; i++) { console.log("a的长度" ,a.length) console.log("i的数值" ,i) b[i] = a[i].offsetTop; console.log("a的offsettop" ,a[i].offsetTop) //把每个大块距离页面最顶部的距离,赋给b数组 } var c = $("section").scrollTop();//页面刷新是获取滚动条的位置 console.log("页面刷新" ,c) // if (c = 0 | c > 0 | c < 0) { //顶部导航栏高80;顶部导航消失的时候让侧边导航出来 // $(".cd-vertical-nav").show(); // if (window.innerWidth < 768) { //小屏的情况下让按钮隐藏/出现 // $(".cd-nav-trigger").show(); // } // } // else { //否则让它隐藏 // $(".cd-vertical-nav").hide(); // if (window.innerWidth < 768) { // $(".cd-nav-trigger").hide(); // } // } // $(window).scroll(function () { //监听滚动条的滚动事件 // c = $(window).scrollTop(); //实时监听滚动条位置 // console.log("实时监控" ,c) // if (c = 0 || c > 0 || c < 0) { //页面滚动时,判断滚动条位置,控制侧边导航的隐显 // $(".cd-vertical-nav").show(); // if (window.innerWidth < 768) { // $(".cd-nav-trigger").show(); // } // } else { // $(".cd-vertical-nav").hide(); // $(".cd-nav-trigger").hide(); // } // //下面是判断页面所处位置,实时更新导航条,是导航栏选项跟页面同步 for (i = 0; i < a.length; i++) { var d = c - b[i]; //c是滚动条位置,b是元素到页面顶部的距离,d表示当前浏览器顶部所处的位置。 var e = a[i].offsetHeight; //获取元素的高度 var f = a[i].id; //获取元素的id var g = $(".cd-vertical-nav a[href='#" + f + "']"); //拼接字符串,通过属性选择器找到当前所处页面对应的超链接 if (d >= 0 && d < e) { if (g.hasClass("active")) { //如果当前元素本就处于激活状态直接break break; } //如果当前页面没有处于激活状态,就将正在激活的移出激活的样式表 $(".cd-vertical-nav .active").removeClass("active"); g.addClass("active"); //给当前需要激活的属性添加激活样式表 break; } } // }); }) //下面为小屏时通过点击按钮开关导航栏, $(".cd-nav-trigger").on("click", function () { //处于open状态,就关闭 if ($(".cd-vertical-nav").hasClass("open")) $(".cd-vertical-nav").removeClass("open"); //反之打开 else $(".cd-vertical-nav").addClass("open"); }) //选中导航某一项后,关闭导航栏 $(".cd-vertical-nav a").on("click", function () { $(".cd-vertical-nav").removeClass("open"); }) //////////////////////////// jQuery(document).ready( function($) { if( $.fn.fsvs ) { var slider = $.fn.fsvs({ speed : 1000, nthClasses : 4, mouseDragEvents : false }); } if( $.fn.flare ) { var flares = $('.flare').flare(); for( var flare in flares ) { //flares[flare].reset(); } } var sectionHeight = $('#fsvs-body > .slide:eq(0)').height(); $('#fsvs-body > .slide').each( function(){ var section = $(this), item = $('.item', section ), demo = $('.demo', section ), itemHeight = item.outerHeight(), demoHeight = demo.outerHeight(); item.css({ marginTop : ( ( sectionHeight - itemHeight ) / 2 ) + 'px' }); demo.css({ marginTop : ( ( sectionHeight - demoHeight ) / 2 ) + 'px' }); }); $(window).load(function(){ }); }); jQuery(".seventy").slide({ mainCell: ".bd ul", autoPage: true, effect: "left", autoPlay: true, vis: 3, easing: "easeOutCirc" }); jQuery(".slideBox").slide({ mainCell: ".bd ul", effect: "left", autoPlay: true, easing: "easeOutCirc", delayTime: 700 }); }]); </script>