PageSourceSearch

http://www.liannan.gov.cn/global/jquery.SuperSlide.js

js liannan.gov.cn collected 2026-10-02 20:59:05 UTC 54,693 bytes, 1,249 lines download raw bytes

1/* 2019-1-18
2
3 * SuperSlide v3.0 alpha开发版
4 * 轻松解决网站大部分特效展示问题
5 *
6 * Copyright 2011-2018, 大话主席 
7 *
8 * 请尊重原创,保留头部版权
9 * 在保留版权的前提下可应用于个人或商业用途
10
11 * v3.0:
12    1、修复 mouseOverStop 和 autoPlay均为false下,点击切换按钮后会自动播放bug;
13    2、interTime默认值改为4000;
14    3、vis默认值改为"auto"
15    4、scroll默认值改为"auto"
16    5、增加参数 responsive -- 默认值ture,是否开启响应式功能
17    6、增加参数 responsiveFun -- 响应式回调函数
18    7、增加参数 responsiveFunTime -- 默认值100,单位毫秒,外框宽度改变(触发响应式)时回调函数执行间隔
19    8、增加参数 autoHeight -- 默认值true,自动适配内容高度,常用于移动端,effect:"left或leftLoop",vis:1,scroll:1时有效
20    9、增加参数 canTouch -- 默认值"auto",移动端有效;是否带触摸拖拽效果;可选"auto"|true|false;auto情况下是除了fade、fold、slideDown不带触摸,其它都带
21    10、重新设计"fold"的实现方式,不再需要计算宽高,现在可以自适应高度
22    11、新增外置方法:
23        play() -- 播放
24        pause() -- 暂停
25        prev() -- 上一页
26        next() -- 下一页
27        goTo(int) -- 跳到第int页
28        refresh() -- 刷新效果
29        reset() -- 重置效果
30        getIndex() -- 获取当前页码
31        getPages() -- 获取总页数
32        clearStyle() -- 清除插件加入的style
33        destroyInter() -- 销毁setInterval和setTimeout
34        destroyEvents() -- 销毁事件绑定
35        destroy() -- 销毁插件(clearStyle() + destroyInter() + destroyEvents())
36
37        使用方式:
38        执行slide后会返回superslide对象集合;
39        例如:
40        var ss = $(".slider").slide({ .... });
41        现在想设置第二个".slider"暂停,执行代码为: ss[1].pause();
42    */
43
44(function ($, win) {
45    $.fn.slide = function (options) {
46        $.fn.slide.defaults = {
47            type: "slide",
48            effect: "fade",
49            autoPlay: false,
50            delayTime: 500,
51            interTime: 4000,
52            triggerTime: 150,
53            defaultIndex: 0,
54            titCell: ".hd li",
55            mainCell: ".bd",
56            targetCell: null,
57            trigger: "mouseover",
58            scroll: "auto",
59            vis: "auto",
60            titOnClassName: "on",
61            autoPage: false,
62            prevCell: ".prev",
63            nextCell: ".next",
64            pageStateCell: ".pageState",
65            opp: false,
66            pnLoop: true,
67            easing: "swing",
68            startFun: null,
69            endFun: null,
70            switchLoad: null,
71
72            playStateCell: ".playState",
73            mouseOverStop: true,
74            defaultPlay: true,
75            returnDefault: false,
76
77            responsive: true,
78            responsiveFun: null,
79            responsiveFunTime: 100,
80            autoHeight: true,
81            canTouch: "auto"
82        };
83
84        var ary = [];
85        var createObj = function (opts, slider) {
86
87            var _this = this;
88            var effect = opts.effect;
89            var prevBtn = $(opts.prevCell, slider);
90            var nextBtn = $(opts.nextCell, slider);
91            var pageState = $(opts.pageStateCell, slider);
92            var playState = $(opts.playStateCell, slider);
93
94            var navObj = $(opts.titCell, slider); //导航子元素结合
95            var navObjSize = navObj.length;
96            var conBox = $(opts.mainCell, slider); //内容元素父层对象
97            var conBoxSize = conBox.children().length;
98            var sLoad = opts.switchLoad;
99            var tarObj = $(opts.targetCell, slider);
100
101            /*字符串转换*/
102            var index = parseInt(opts.defaultIndex);
103            var delayTime = parseInt(opts.delayTime);
104            var interTime = parseInt(opts.interTime);
105            var triggerTime = parseInt(opts.triggerTime);
106
107            var scroll = isNaN(opts.scroll) ? "auto" : parseInt(opts.scroll);
108            var vis = isNaN(opts.vis) ? "auto" : parseInt(opts.vis);
109
110            var autoPlay = (opts.autoPlay == "false" || opts.autoPlay == false) ? false : true;
111            var opp = (opts.opp == "false" || opts.opp == false) ? false : true;
112            var autoPage = (opts.autoPage == "false" || opts.autoPage == false) ? false : true;
113            var pnLoop = (opts.pnLoop == "false" || opts.pnLoop == false) ? false : true;
114            var mouseOverStop = (opts.mouseOverStop == "false" || opts.mouseOverStop == false) ? false : true;
115            var defaultPlay = (opts.defaultPlay == "false" || opts.defaultPlay == false) ? false : true;
116            var returnDefault = (opts.returnDefault == "false" || opts.returnDefault == false) ? false : true;
117            var canTouch = opts.canTouch;
118
119            //触摸相关
120            var supportTouch = !!("ontouchstart" in window || window.navigator.msMaxTouchPoints);
121            if (canTouch == "auto") {
122                if (("left leftLoop leftMarquee top topLoop topMarquee").indexOf(effect) != -1) {
123                    canTouch = true;
124                } else {
125                    canTouch = false;
126                }
127            } else {
128                canTouch = (opts.canTouch == "false" || opts.canTouch == false) ? false : true;
129            }
130            canTouch = (canTouch && supportTouch) ? true : false;
131
132            var touchStart = supportTouch ? 'touchstart' : 'touchstart';
133            var touchMove = supportTouch ? 'touchmove' : 'touchmove';
134            var touchEnd = supportTouch ? 'touchend' : 'touchend';
135            // var touchStart = supportTouch ? 'touchstart' : 'mousedown';
136            // var touchMove = supportTouch ? 'touchmove' : 'mousemove';
137            // var touchEnd = supportTouch ? 'touchend' : 'mouseup';
138
139            //内部使用变量
140            var slideH = 0;
141            var slideW = 0;
142            var selfW = 0;
143            var selfH = 0;
144            var easing = opts.easing;
145            var inter = null; //autoPlay-setInterval
146            var titST = null; //titCell-setTimeout
147            var rtnST = null; //返回默认-setTimeout
148            var pnST = null; //前后按钮长安-setTimeout
149            var resizeST = null; //win响应式-setTimeout
150            var titOn = opts.titOnClassName;
151
152            var onIndex = navObj.index(slider.find("." + titOn));
153            var oldIndex = index = onIndex == -1 ? index : onIndex;
154            var defaultIndex = index;
155            var scrollNum = 0;
156
157            var _ind = index;
158            var cloneNum = 0;
159            var _tar;
160            var isMarq = effect == "leftMarquee" || effect == "topMarquee" ? true : false;
161            var isLeftEffectForTouch = ("left leftLoop leftMarquee fade fold").indexOf(effect) == -1 ? false : true;
162            var isTopEffectForTouch = ("top topLoop topMarquee fade fold").indexOf(effect) == -1 ? false : true;
163            var isLeftEffect = ("left leftLoop leftMarquee").indexOf(effect) == -1 ? false : true;
164            var isTopEffect = ("top topLoop topMarquee").indexOf(effect) == -1 ? false : true;
165            var conBoxParWidth = conBox.parent().width();
166            var conBoxParHeight = conBox.parent().height();
167
168            var responsiveCallBack = function () {
169                if ($.isFunction(opts.responsiveFun)) {
170                    opts.responsiveFun(index,
171                        navObjSize,
172                        slider,
173                        $(opts.titCell, slider),
174                        conBox,
175                        tarObj,
176                        prevBtn,
177                        nextBtn);
178                }
179            };
180            var startCallBack = function () {
181                if ($.isFunction(opts.startFun)) {
182                    opts.startFun(index, navObjSize, slider, $(opts.titCell, slider), conBox, tarObj, prevBtn, nextBtn);
183                }
184            };
185            var endCallBack = function () {
186                if ($.isFunction(opts.endFun)) {
187                    opts.endFun(index, navObjSize, slider, $(opts.titCell, slider), conBox, tarObj, prevBtn, nextBtn);
188                }
189            };
190            var resetOn = function () {
191                navObj.removeClass(titOn);
192                if (defaultPlay) {
193                    navObj.eq(defaultIndex).addClass(titOn);
194                }
195            };
196
197            //绑定titCell事件
198            var titCellEvent = function (o) {
199                if (opts.trigger == "mouseover") {
200                    o.hover(function () {
201                            var hoverInd = o.index(this);
202                            titST = setTimeout(function () {
203                                    index = hoverInd;
204                                    doPlay();
205                                    resetInter();
206                                },
207                                opts.triggerTime);
208                        },
209                        function () { clearTimeout(titST) });
210                } else {
211                    o.click(function () {
212                        index = o.index(this);
213                        doPlay();
214                        resetInter();
215                    });
216                }
217            };
218
219            //单独处理菜单效果
220            if (opts.type == "menu") {
221                if (defaultPlay) {
222                    navObj.removeClass(titOn).eq(index).addClass(titOn);
223                }
224                navObj.hover(
225                    function () {
226                        _tar = $(this).find(opts.targetCell);
227                        var hoverInd = navObj.index($(this));
228
229                        titST = setTimeout(function () {
230                                index = hoverInd;
231                                navObj.removeClass(titOn).eq(index).addClass(titOn);
232                                startCallBack();
233                                switch (effect) {
234                                    case "fade":
235                                        _tar.stop(true, true).animate({ opacity: "show" },
236                                            delayTime,
237                                            easing,
238                                            endCallBack);
239                                        break;
240                                    case "slideDown":
241                                        _tar.stop(true, true).animate({ height: "show" },
242                                            delayTime,
243                                            easing,
244                                            endCallBack);
245                                        break;
246                                }
247                            },
248                            opts.triggerTime);
249
250                    },
251                    function () {
252                        clearTimeout(titST);
253                        switch (effect) {
254                            case "fade":
255                                _tar.animate({ opacity: "hide" }, delayTime, easing);
256                                break;
257                            case "slideDown":
258                                _tar.animate({ height: "hide" }, delayTime, easing);
259                                break;
260                        }
261                    }
262                );
263
264                if (returnDefault) {
265                    slider.hover(function () { clearTimeout(rtnST); },
266                        function () { rtnST = setTimeout(resetOn, delayTime); });
267                }
268
269                return;
270            }
271
272            //切换加载
273            var doSwitchLoad = function (objs) {
274
275                var changeImg = function (t) {
276                    for (var i = t; i < (vis + t); i++) {
277                        objs.eq(i).find("img[" + sLoad + "]").each(function () {
278                            var _t = $(this);
279                            _t.attr("src", _t.attr(sLoad));
280                            if (conBox.find(".clone")[0]) { //如果存在.clone
281                                var chir = conBox.children();
282                                for (var j = 0; j < chir.length; j++) {
283                                    chir.eq(j).find("img[" + sLoad + "]").each(function () {
284                                        if ($(this).attr(sLoad) == _t.attr("src")) {
285                                            $(this).attr("src", $(this).attr(sLoad));
286                                        }
287                                    });
288                                }
289                            }
290                        });
291                    }
292                };
293                switch (effect) {
294                    case "fade":
295                    case "fold":
296                    case "top":
297                    case "left":
298                    case "slideDown":
299                        changeImg(index * scroll);
300                        break;
301                    case "leftLoop":
302                    case "topLoop":
303                        changeImg(cloneNum + scrollNum(_ind));
304                        break;
305                    case "leftMarquee":
306                    case "topMarquee":
307                        var curS = effect == "leftMarquee"
308                            ? conBox.css("left").replace("px", "")
309                            : conBox.css("top").replace("px", "");
310                        var slideT = effect == "leftMarquee" ? slideW : slideH;
311                        var mNum = cloneNum;
312                        if (curS % slideT != 0) {
313                            var curP = Math.abs(curS / slideT ^ 0);
314                            if (index == 1) {
315                                mNum = cloneNum + curP;
316                            } else {
317                                mNum = cloneNum + curP - 1;
318                            }
319                        }
320                        changeImg(mNum);
321                        break;
322                }
323            }; //doSwitchLoad end
324
325            //初始化
326            var setInit = function () {
327                var tempIndex = index;
328                if (true) {
329                }
330                selfW = 0;
331                selfH = 0;
332                conBox.children().each(function () { //取最大值
333                    if ($(this).width() > selfW) {
334                        selfW = $(this).width();
335                        slideW = $(this).outerWidth(true);
336                    }
337                    if ($(this).height() > selfH) {
338                        selfH = $(this).height();
339                        slideH = $(this).outerHeight(true);
340                    }
341                });
342
343                if (opts.vis == "auto") {
344                    if (isTopEffect) {
345                        vis = parseInt(conBoxParHeight / slideH);
346                    } else {
347                        vis = parseInt(conBoxParWidth / slideW);
348                    }
349
350                    vis = vis == 0 ? 1 : vis;
351                }
352                if (opts.scroll == "auto") {
353                    scroll = vis;
354                }
355                cloneNum = conBoxSize >= vis ? (conBoxSize % scroll != 0 ? conBoxSize % scroll : scroll) : 0;
356
357                //处理分页
358                if (navObjSize == 0) {
359                    navObjSize = conBoxSize;
360                }
361                //只有左右按钮
362                if (isMarq) {
363                    navObjSize = 2;
364                    tempIndex = 0;
365                }
366                if (autoPage) {
367                    if (conBoxSize >= vis) {
368                        if (effect == "leftLoop" || effect == "topLoop") {
369                            navObjSize = conBoxSize % scroll != 0 ? (conBoxSize / scroll ^ 0) + 1 : conBoxSize / scroll;
370                        }
371                        //else if (isMarq){ navObjSize=2 }
372                        else {
373                            var tempS = conBoxSize - vis;
374                            navObjSize = 1 + parseInt(tempS % scroll != 0 ? (tempS / scroll + 1) : (tempS / scroll));
375                            if (navObjSize <= 0) {
376                                navObjSize = 1;
377                            }
378                        }
379                    } else {
380                        navObjSize = 1;
381                    }
382
383                    $(opts.titCell, slider).empty();
384
385                    var str = "";
386
387                    if (opts.autoPage == true || opts.autoPage == "true") {
388                        for (var i = 0; i < navObjSize; i++) {
389                            str += "<li>" + (i + 1) + "</li>";
390                        }
391                    } else {
392                        for (var i = 0; i < navObjSize; i++) {
393                            str += opts.autoPage.replace("$", (i + 1));
394                        }
395                    }
396                    $(opts.titCell, slider).html(str);
397
398                    navObj = $(opts.titCell, slider).children(); //重置导航子元素对象
399                    navObj.eq(index).addClass(titOn);
400
401                    titCellEvent(navObj);
402
403                }
404
405                if (conBoxSize >= vis) { //当内容个数少于可视个数,不执行效果。
406
407                    //console.log(vis+"|"+cloneNum);
408
409                    var cloneEle = function () {
410                        var _chr = conBox.children();
411                        for (var i = 0; i < vis; i++) {
412                            _chr.eq(i).clone().addClass("clone").appendTo(conBox);
413                        }
414                        for (var i = 0; i < cloneNum; i++) {
415                            _chr.eq(conBoxSize - i - 1).clone().addClass("clone").prependTo(conBox);
416                        }
417                    };
418                    switch (effect) {
419                        case "fold":
420                            conBox.css({ "overflow": "hidden" }).children().css({
421                                "width": "100%",
422                                "float": "left",
423                                "marginRight": "-100%",
424                                "display": "none"
425                            });
426                            break;
427
428                        case "top":
429                            conBox.wrap('<div class="tempWrap" style="overflow:hidden; position:relative; height:' +
430                                    vis * slideH +
431                                    'px"></div>')
432                                .css({
433                                    "top": -(tempIndex * scroll) * slideH,
434                                    "position": "relative",
435                                    "padding": "0",
436                                    "margin": "0"
437                                }).children().css({ "height": selfH });
438                            break;
439                        case "left":
440                            var visScope = isNaN(opts.vis) ? opts.vis : vis * slideW + 'px';
441                            conBox.wrap('<div class="tempWrap" style="overflow:hidden; position:relative; width:' +
442                                visScope +
443                                '"></div>');
444                            conBox.css({
445                                "width": conBoxSize * slideW,
446                                "left": -(tempIndex * scroll) * slideW,
447                                "position": "relative",
448                                "overflow": "hidden",
449                                "padding": "0",
450                                "margin": "0"
451                            }).children().css({ "float": "left", "width": selfW });
452
453                            break;
454                        case "leftLoop":
455                        case "leftMarquee":
456                            cloneEle();
457                            var visScope = isNaN(opts.vis) ? "100%" : vis * slideW + 'px';
458                            conBox.wrap('<div class="tempWrap" style="overflow:hidden; position:relative; width:' +
459                                visScope +
460                                '"></div>');
461                            conBox.css({
462                                "width": (conBoxSize + vis + 1 + cloneNum) * slideW,
463                                "position": "relative",
464                                "overflow": "hidden",
465                                "padding": "0",
466                                "margin": "0",
467                                "left": -(cloneNum + tempIndex * scroll) * slideW
468                            }).children().css({ "float": "left", "width": selfW });
469
470                            break;
471                        case "topLoop":
472                        case "topMarquee":
473                            cloneEle();
474                            conBox
475                                .wrap('<div class="tempWrap" style="overflow:hidden; position:relative; height:' +
476                                    vis * slideH +
477                                    'px"></div>')
478                                .css({
479                                    "height": (conBoxSize + vis + cloneNum) * slideH,
480                                    "position": "relative",
481                                    "padding": "0",
482                                    "margin": "0",
483                                    "top": -(cloneNum + tempIndex * scroll) * slideH
484                                }).children().css({ "height": selfH });
485                            break;
486                    }
487
488                }
489
490                //针对leftLoop、topLoop的滚动个数
491                scrollNum = function (ind) {
492                    var _tempCs = ind * scroll;
493                    if (ind == navObjSize) {
494                        _tempCs = conBoxSize;
495                    } else if (ind == -1 && conBoxSize % scroll != 0) {
496                        _tempCs = -conBoxSize % scroll;
497                    }
498                    return _tempCs;
499                };
500
501                //pageState.html( "<span>"+(index+1)+"</span>/"+navObjSize);
502
503            }; //setInit End
504            setInit();
505            responsiveCallBack();
506
507            //效果函数
508            var doPlay = function (_setInit) {
509                // 当前页状态不触发效果
510                if (defaultPlay && oldIndex == index && !_setInit && !isMarq) {
511                    return;
512                }
513
514                //处理页码
515                if (isMarq) {
516                    if (index >= 1) {
517                        index = 1;
518                    } else if (index <= 0) {
519                        index = 0;
520                    }
521                } else {
522                    _ind = index;
523                    if (index >= navObjSize) {
524                        index = 0;
525                    } else if (index < 0) {
526                        index = navObjSize - 1;
527                    }
528                }
529
530                //处理切换加载
531                if (sLoad != null) {
532                    doSwitchLoad(conBox.children());
533                }
534
535                startCallBack();
536
537                //处理targetCell
538                if (tarObj[0]) {
539                    _tar = tarObj.eq(index);
540                    if (sLoad != null) {
541                        doSwitchLoad(tarObj);
542                    }
543                    if (effect == "slideDown") {
vendor: 4,156 bytes, lines 544-621
544                        tarObj.not(_tar).stop(true, true).slideUp(delayTime);
545                        _tar.slideDown(delayTime,
546                            easing,
547                            function () {
548                                if (!conBox[0]) {
549                                    endCallBack();
550                                }
551                            });
552                    } else {
553                        tarObj.not(_tar).stop(true, true).hide();
554                        _tar.animate({ opacity: "show" },
555                            delayTime,
556                            function () {
557                                if (!conBox[0]) {
558                                    endCallBack();
559                                }
560                            });
561                    }
562                }
563
564                if (conBoxSize >= vis) { //当内容个数少于可视个数,不执行效果。
565                    switch (effect) {
566                        case "fade":
567                            conBox.children().stop(true, true).eq(index).animate({ opacity: "show" },
568                                delayTime,
569                                easing,
570                                function () { endCallBack() }).siblings().hide();
571                            break;
572                        case "fold":
573                            conBox.children().stop(true, true).eq(index)
574                                .animate({ opacity: "show" }, delayTime, easing, function () { endCallBack() })
575                                .siblings().animate({ opacity: "hide" }, delayTime, easing);
576                            break;
577                        case "top":
578                            conBox.stop(true, false).animate({ "top": -index * scroll * slideH },
579                                delayTime,
580                                easing,
581                                function () { endCallBack() });
582                            break;
583                        case "left":
584                            conBox.stop(true, false).animate({ "left": -index * scroll * slideW },
585                                delayTime,
586                                easing,
587                                function () { endCallBack() });
588                            break;
589                        case "leftLoop":
590                            var __ind = _ind;
591                            conBox.stop(true, true).animate({ "left": -(scrollNum(_ind) + cloneNum) * slideW },
592                                delayTime,
593                                easing,
594                                function () {
595                                    if (__ind <= -1) {
596                                        conBox.css("left", -(cloneNum + (navObjSize - 1) * scroll) * slideW);
597                                    } else if (__ind >= navObjSize) {
598                                        conBox.css("left", -cloneNum * slideW);
599                                    }
600                                    endCallBack();
601                                });
602                            break; //leftLoop end
603
604                        case "topLoop":
605                            var __ind = _ind;
606                            conBox.stop(true, true).animate({ "top": -(scrollNum(_ind) + cloneNum) * slideH },
607                                delayTime,
608                                easing,
609                                function () {
610                                    if (__ind <= -1) {
611                                        conBox.css("top", -(cloneNum + (navObjSize - 1) * scroll) * slideH);
612                                    } else if (__ind >= navObjSize) {
613                                        conBox.css("top", -cloneNum * slideH);
614                                    }
615                                    endCallBack();
616                                });
617                            break; //topLoop end
618
619                        case "leftMarquee":
620                            var tempLeft = conBox.css("left").replace("px", "");
621                            if (index == 0) {
622                                conBox.animate({ "left": ++tempLeft },
623                                    0,
624                                    function () {
625                                        if (conBox.css("left").replace("px", "") >= 0) {
626                                            conBox.css("left", -conBoxSize * slideW);
627                                        }
628                                    });
629                            } else {
630                                conBox.animate({ "left": --tempLeft },
631                                    0,
632                                    function () {
633                                        if (conBox.css("left").replace("px", "") <= -(conBoxSize + cloneNum) * slideW) {
634                                            conBox.css("left", -cloneNum * slideW);
635                                        }
636                                    });
637                            }
638                            break; // leftMarquee end
639
640                        case "topMarquee":
641                            var tempTop = conBox.css("top").replace("px", "");
642                            if (index == 0) {
643                                conBox.animate({ "top": ++tempTop },
644                                    0,
645                                    function () {
646                                        if (conBox.css("top").replace("px", "") >= 0) {
647                                            conBox.css("top", -conBoxSize * slideH);
648                                        }
649                                    });
650                            } else {
651                                conBox.animate({ "top": --tempTop },
652                                    0,
653                                    function () {
654                                        if (conBox.css("top").replace("px", "") <= -(conBoxSize + cloneNum) * slideH) {
655                                            conBox.css("top", -cloneNum * slideH);
656                                        }
657                                    });
658                            }
659                            break; // topMarquee end
660
661                    } //switch end
662                }
663
664                navObj.removeClass(titOn).eq(index).addClass(titOn);
665
666                oldIndex = index;
667                if (!pnLoop) { //pnLoop控制前后按钮是否继续循环
668                    nextBtn.removeClass("nextStop");
669                    prevBtn.removeClass("prevStop");
670                    if (index == 0) {
671                        prevBtn.addClass("prevStop");
672                    }
673                    if (index == navObjSize - 1) {
674                        nextBtn.addClass("nextStop");
675                    }
676                }
677
678                pageState.html("<span>" + (index + 1) + "</span>/" + navObjSize);
679
680                // 自动适配高度
681                if (opts.autoHeight && (effect == "left" || effect == "leftLoop") && vis == 1 && scroll == 1) {
682                    var curItem = conBox.children().not(conBox.find(".clone")).eq(index);
683                    var pic = curItem.find("img");
684                    var picCount = pic.length;
685
686                    if (picCount <= 0) {
687                        conBox.height(curItem.outerHeight());
688                        return;
689                    }
690                    pic.each(function () { //存在图片时监测图片高度
691                        var img = $(this);
692                        var imgInt = setInterval(function () {
693                                if (img.height() > 0) {
694                                    clearInterval(imgInt);
695                                    picCount--;
696                                    if (picCount <= 0) {
697                                        conBox.height(curItem.outerHeight());
698                                    }
699                                }
700                            },
701                            50);
702                    });
703                }
704
705            }; // doPlay end
706
707            //初始化执行
708            if (defaultPlay) {
709                doPlay(true);
710            }
711
712            //返回默认状态
713            if (returnDefault) {
714                slider.hover(function () { clearTimeout(rtnST) },
715                    function () {
716                        rtnST = setTimeout(function () {
717                                index = defaultIndex;
718                                if (defaultPlay) {
719                                    doPlay();
720                                } else {
721                                    if (effect == "slideDown") {
722                                        _tar.slideUp(delayTime, resetOn);
723                                    } else {
724                                        _tar.animate({ opacity: "hide" }, delayTime, resetOn);
725                                    }
726                                }
727                                oldIndex = index;
728                            },
729                            300);
730                    });
731            }
732
733            ///自动播放函数
734            var setInter = function (time) {
735                inter = setInterval(function () {
736                        opp ? index-- : index++;
737                        doPlay();
738                    },
739                    !!time ? time : interTime);
740            };
741            var setMarInter = function (time) { inter = setInterval(doPlay, !!time ? time : interTime); };
742            // 处理mouseOverStop
743            var resetInter = function () {
744                if (!mouseOverStop && autoPlay && !playState.hasClass("pauseState")) {
745                    clearInterval(inter);
746                    setInter();
747                }
748            }; /* 修复 mouseOverStop 和 autoPlay均为false下,点击切换按钮后会自动播放bug */
749            // 前后按钮函数
750            var nextFun = function () {
751                if (pnLoop || index != navObjSize - 1) {
752                    index++;
753                    doPlay();
754                    if (!isMarq) {
755                        resetInter();
756                    }
757                }
758            };
759            var prevFun = function () {
760                if (pnLoop || index != 0) {
761                    index--;
762                    doPlay();
763                    if (!isMarq) {
764                        resetInter();
765                    }
766                }
767            };
768            //处理playState
769            var playStateFun = function () {
770                autoPlay = true;
771                clearInterval(inter);
772                playState.removeClass("pauseState");
773                isMarq ? setMarInter() : setInter();
774            };
775            var pauseStateFun = function () {
776                autoPlay = false;
777                clearInterval(inter);
778                playState.addClass("pauseState");
779            };
780
781            //初始化自动播放
782            var setAutoPlay = function () {
783                if (autoPlay) {
784                    if (isMarq) {
785                        opp ? index-- : index++;
786                        setMarInter();
787                        if (mouseOverStop) {
788                            conBox.hover(pauseStateFun, playStateFun);
789                        }
790                    } else {
791                        setInter();
792                        if (mouseOverStop) {
793                            slider.hover(pauseStateFun, playStateFun);
794                        }
795                    }
796                } else {
797                    if (isMarq) {
798                        opp ? index-- : index++;
799                    }
800                    playState.addClass("pauseState");
801                }
802            };
803            setAutoPlay();
804
805            //绑定事件
806            var setTrigger = function () {
807                playState.click(function () { playState.hasClass("pauseState") ? playStateFun() : pauseStateFun() });
808
809                titCellEvent(navObj);
810                //前后按钮事件
811                if (isMarq) {
812                    nextBtn.mousedown(nextFun);
813                    prevBtn.mousedown(prevFun);
814                    //前后按钮长按10倍加速
815                    if (pnLoop) {
816
817                        var marDown = function () {
818                            pnST = setTimeout(function () {
819                                    clearInterval(inter);
820                                    setMarInter(interTime / 10 ^ 0);
821                                },
822                                150);
823                        };
824                        var marUp = function () {
825                            clearTimeout(pnST);
826                            clearInterval(inter);
827                            setMarInter();
828                        };
829                        nextBtn.mousedown(marDown);
830                        nextBtn.mouseup(marUp);
831                        prevBtn.mousedown(marDown);
832                        prevBtn.mouseup(marUp);
833                    }
834                    //前后按钮mouseover事件
835                    if (opts.trigger == "mouseover") {
836                        nextBtn.hover(nextFun, function () {});
837                        prevBtn.hover(prevFun, function () {});
838                    }
839                } else {
840                    nextBtn.click(nextFun);
841                    prevBtn.click(prevFun);
842                }
843
844                //触摸事件
845                if (canTouch) {
846                    conBox.on(touchStart,
847                        function (e) {
848
849                            conBox.stop(1, 1);
850                            clearInterval(inter);
851                            conBox.find("a").click(function (e) { e.preventDefault() });
852
853                            e = supportTouch ? e.originalEvent.targetTouches[0] : (e || window.event);
854
855                            var distX,
856                                distY,
857                                oX,
858                                oY,
859                                oL,
860                                oT;
861                            var _this = $(this);
862                            oL = this.offsetLeft;
863                            oT = this.offsetTop;
864                            oX = e.pageX;
865                            oY = e.pageY;
866                            var scrollY = false;
867
868                            $(this).on(touchMove,
869                                function (ev) {
870
871                                    e = supportTouch ? ev.originalEvent.targetTouches[0] : (ev || window.event);
872                                    distX = e.pageX - oX;
873                                    distY = e.pageY - oY;
874
875                                    scrollY = Math.abs(distX) < Math.abs(distY) ? true : false;
876
877                                    if (!scrollY && isLeftEffectForTouch) {
878                                        ev.preventDefault();
879                                        if (effect == "left" &&
880                                            ((index == 0 && distX > 0) || (index >= navObjSize - 1 && distX < 0))) {
881                                            distX = distX * 0.4;
882                                        }
883                                        _this.css({ "left": oL + distX + "px" });
884
885                                    } else if (scrollY && isTopEffectForTouch) {
886
887                                        ev.preventDefault();
888                                        if (effect == "top" &&
889                                            ((index == 0 && distY > 0) || (index >= navObjSize - 1 && distY < 0))) {
890                                            distY = distY * 0.4;
891                                        }
892                                        _this.css({ "top": oT + distY + "px" });
893                                    }
894
895                                });
896
897                            $(this).on(touchEnd,
898                                function (e) {
899
900                                    if (!distX) {
901                                        conBox.find("a").off("click");
902                                    } else if (!scrollY && isLeftEffectForTouch) {
903                                        if (Math.abs(distX) > slideW / 10) {
904                                            distX > 0 ? index-- : index++;
905                                            if (effect == "left") {
906                                                index = index < 0 ? 0 : index;
907                                                index = index >= navObjSize ? navObjSize - 1 : index;
908                                            }
909                                        }
910                                        doPlay(true);
911                                    } else if (scrollY && isTopEffectForTouch) {
912                                        if (Math.abs(distY) > slideH / 10) {
913                                            distY > 0 ? index-- : index++;
914                                            if (effect == "top") {
915                                                index = index < 0 ? 0 : index;
916                                                index = index >= navObjSize ? navObjSize - 1 : index;
917                                            }
918                                        }
919                                        doPlay(true);
920                                    }
921
922                                    clearInterval(inter);
923                                    playState.removeClass("pauseState");
924                                    if (autoPlay) {
925                                        isMarq ? setMarInter() : setInter();
926                                    }
927
928                                    conBox.off(touchMove);
929                                    conBox.off(touchEnd);
930
931                                });
932
933                        });
934                }
935
936            };
937            setTrigger();
938
939            // 为检测设备尺寸变化,清除一些附加样色和元素
940            var clear = function () {
941                conBox.stop(true, true);
942                if (conBox.parent().hasClass("tempWrap")) {
943                    conBox.unwrap("tempWrap");
944                };
945                conBox.find(".clone").remove();
946                if (isLeftEffect) {
947                    conBox.children().css({ "width": "", "float": "" });
948                    conBox.css({ "width": "", "left": 0 });
949                } else if (isTopEffect) {
950                    conBox.children().css({ "height": "" });
951                    conBox.css({ "height": "", "top": 0 });
952                }
953            };
954
955            //检测设备尺寸变化
956            var setResponsive = function () {
957                if (opts.responsive) {
958                    var _vis;
959                    var _conBoxParWidth;
960                    var _conBoxParHeight;
961                    var orientationChange = function () {
962                        responsiveCallBack();
963                        _conBoxParWidth = conBox.parent().width();
964                        _conBoxParHeight = conBox.parent().height();
965
966                        if (isLeftEffect && _conBoxParWidth != conBoxParWidth) { //外层宽度有变化才执行
967                            conBoxParWidth = _conBoxParWidth;
968
969                            //处理sLoad
970                            /*
971                            _vis = parseInt( conBox.parent().width() / slideW );
972                            vis = _vis;
973                            if( opts.scroll=="auto" ){ scroll = vis }*/
974
975                            clear();
976                            setInit();
977                            doPlay(true);
978                        } else if (isTopEffect && _conBoxParHeight != conBoxParHeight) { //外层高度有变化才执行
979                            conBoxParHeight = _conBoxParHeight;
980                            clear();
981                            setInit();
982                            doPlay(true);
983                        }
984                    };
985                    $(win).resize(function () {
986                        if (resizeST) {
987                            clearTimeout(resizeST);
988                        }
989                        resizeST = setTimeout(orientationChange, opts.responsiveFunTime);
990                    });
991                }
992            };
993            setResponsive();
994
995            /*-- 外置API --*/
996            //清除所有附加元素和样色
997            this.clearStyle = function () {
998                if (conBox.parent().hasClass("tempWrap")) {
999                    conBox.unwrap("tempWrap");
1000                };
1001                conBox.find(".clone").remove();
1002                conBox.children().removeAttr("style");
1003                conBox.removeAttr("style");
1004            };
1005
1006            //销毁setInterval和setTimeout
1007            this.destroyInter = function () {
1008                clearInterval(inter);
1009                clearTimeout(rtnST);
1010                clearTimeout(titST);
1011                clearTimeout(pnST);
1012                //clearTimeout(resizeST);
1013            };
1014
1015            //销毁事件绑定
1016            this.destroyEvents = function () {
1017                nextBtn.off();
1018                prevBtn.off();
1019                conBox.off();
1020                slider.off();
1021                navObj.off();
1022                //$(win).off();
1023            };
1024
1025            //销毁插件
1026            this.destroy = function () {
1027                this.destroyEvents();
1028                this.destroyInter();
1029                this.clearStyle();
1030            };
1031
1032            //刷新
1033            this.refresh = function () {
1034                this.destroy();
1035                setInit();
1036                setTrigger();
1037                doPlay(true);
1038                setAutoPlay();
1039            };
1040
1041            //重置(待完善)
1042            this.reset = function () {
1043                index = parseInt(opts.defaultIndex);
1044                scroll = isNaN(opts.scroll) ? "auto" : parseInt(opts.scroll);
1045                vis = isNaN(opts.vis) ? "auto" : parseInt(opts.vis);
1046                autoPlay = (opts.autoPlay == "false" || opts.autoPlay == false) ? false : true;
1047                navObjSize = navObj.length;
1048                conBoxSize = conBox.children().length;
1049                this.refresh();
1050            };
1051
1052            //获取当前索引/页码
1053            this.getIndex = function () { return index };
1054            //获取总页数
1055            this.getPages = function () { return navObjSize };
1056
1057            //暂停
1058            this.pause = function () { pauseStateFun() };
1059            this.play = function () { playStateFun() };
1060            this.prev = function () { prevFun() };
1061            this.next = function () { nextFun() };
1062            this.goTo = function (i) {
1063                resetInter();
1064                if (pnLoop || i != navObjSize) {
1065                    index = i;
1066                    doPlay();
1067                }
1068            };
1069        }; //createObj End
1070
1071        this.each(function () {
1072            var o = new createObj($.extend({}, $.fn.slide.defaults, options), $(this));
1073            ary.push(o);
1074        }); //each End
1075
1076        return ary;
1077
1078    }; //slide End
1079
1080})(jQuery, window);
1081
1082jQuery.easing['jswing'] = jQuery.easing['swing'];
1083jQuery.extend(jQuery.easing,
1084    {
1085        def: 'easeOutQuad',
1086        swing: function (x, t, b, c, d) { return jQuery.easing[jQuery.easing.def](x, t, b, c, d); },
1087        easeInQuad: function (x, t, b, c, d) { return c * (t /= d) * t + b; },
1088        easeOutQuad: function (x, t, b, c, d) { return -c * (t /= d) * (t - 2) + b },
1089        easeInOutQuad: function (x, t, b, c, d) {
1090            if ((t /= d / 2) < 1) {
1091                return c / 2 * t * t + b;
1092            }
1093            return -c / 2 * ((--t) * (t - 2) - 1) + b;
1094        },
1095        easeInCubic: function (x, t, b, c, d) { return c * (t /= d) * t * t + b },
1096        easeOutCubic: function (x, t, b, c, d) { return c * ((t = t / d - 1) * t * t + 1) + b },
1097        easeInOutCubic: function (x, t, b, c, d) {
1098            if ((t /= d / 2) < 1) {
1099                return c / 2 * t * t * t + b;
1100            }
1101            return c / 2 * ((t -= 2) * t * t + 2) + b;
1102        },
1103        easeInQuart: function (x, t, b, c, d) { return c * (t /= d) * t * t * t + b },
1104        easeOutQuart: function (x, t, b, c, d) { return -c * ((t = t / d - 1) * t * t * t - 1) + b },
1105        easeInOutQuart: function (x, t, b, c, d) {
1106            if ((t /= d / 2) < 1) {
1107                return c / 2 * t * t * t * t + b;
1108            }
1109            return -c / 2 * ((t -= 2) * t * t * t - 2) + b;
1110        },
1111        easeInQuint: function (x, t, b, c, d) { return c * (t /= d) * t * t * t * t + b },
1112        easeOutQuint: function (x, t, b, c, d) { return c * ((t = t / d - 1) * t * t * t * t + 1) + b },
1113        easeInOutQuint: function (x, t, b, c, d) {
1114            if ((t /= d / 2) < 1) {
1115                return c / 2 * t * t * t * t * t + b;
1116            }
1117            return c / 2 * ((t -= 2) * t * t * t * t + 2) + b;
1118        },
1119        easeInSine: function (x, t, b, c, d) { return -c * Math.cos(t / d * (Math.PI / 2)) + c + b },
1120        easeOutSine: function (x, t, b, c, d) { return c * Math.sin(t / d * (Math.PI / 2)) + b },
1121        easeInOutSine: function (x, t, b, c, d) { return -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b },
1122        easeInExpo: function (x, t, b, c, d) { return (t == 0) ? b : c * Math.pow(2, 10 * (t / d - 1)) + b },
1123        easeOutExpo: function (x, t, b, c, d) { return (t == d) ? b + c : c * (-Math.pow(2, -10 * t / d) + 1) + b },
1124        easeInOutExpo: function (x, t, b, c, d) {
1125            if (t == 0) {
1126                return b;
1127            }
1128            if (t == d) {
1129                return b + c;
1130            }
1131            if ((t /= d / 2) < 1) {
1132                return c / 2 * Math.pow(2, 10 * (t - 1)) + b;
1133            }
1134            return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b;
1135        },
1136        easeInCirc: function (x, t, b, c, d) { return -c * (Math.sqrt(1 - (t /= d) * t) - 1) + b },
1137        easeOutCirc: function (x, t, b, c, d) { return c * Math.sqrt(1 - (t = t / d - 1) * t) + b },
1138        easeInOutCirc: function (x, t, b, c, d) {
1139            if ((t /= d / 2) < 1) {
1140                return -c / 2 * (Math.sqrt(1 - t * t) - 1) + b;
1141            }
1142            return c / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + b;
1143        },
1144        easeInElastic: function (x, t, b, c, d) {
1145            var s = 1.70158;
1146            var p = 0;
1147            var a = c;
1148            if (t == 0) {
1149                return b;
1150            }
1151            if ((t /= d) == 1) {
1152                return b + c;
1153            }
1154            if (!p) {
1155                p = d * .3;
1156            }
1157            if (a < Math.abs(c)) {
1158                a = c;
1159                var s = p / 4;
1160            } else {
1161                var s = p / (2 * Math.PI) * Math.asin(c / a);
1162            }
1163            return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;
1164        },
1165        easeOutElastic: function (x, t, b, c, d) {
1166            var s = 1.70158;
1167            var p = 0;
1168            var a = c;
1169            if (t == 0) {
1170                return b;
1171            }
1172            if ((t /= d) == 1) {
1173                return b + c;
1174            }
1175            if (!p) {
1176                p = d * .3;
1177            }
1178            if (a < Math.abs(c)) {
1179                a = c;
1180                var s = p / 4;
1181            } else {
1182                var s = p / (2 * Math.PI) * Math.asin(c / a);
1183            }
1184            return a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b;
1185        },
1186        easeInOutElastic: function (x, t, b, c, d) {
1187            var s = 1.70158;
1188            var p = 0;
1189            var a = c;
1190            if (t == 0) {
1191                return b;
1192            }
1193            if ((t /= d / 2) == 2) {
1194                return b + c;
1195            }
1196            if (!p) {
1197                p = d * (.3 * 1.5);
1198            }
1199            if (a < Math.abs(c)) {
1200                a = c;
1201                var s = p / 4;
1202            } else {
1203                var s = p / (2 * Math.PI) * Math.asin(c / a);
1204            }
1205            if (t < 1) {
1206                return -.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;
1207            }
1208            return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p) * .5 + c + b;
1209        },
1210        easeInBack: function (x, t, b, c, d, s) {
1211            if (s == undefined) {
1212                s = 1.70158;
1213            }
1214            return c * (t /= d) * t * ((s + 1) * t - s) + b;
1215        },
1216        easeOutBack: function (x, t, b, c, d, s) {
1217            if (s == undefined) {
1218                s = 1.70158;
1219            }
1220            return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b;
1221        },
1222        easeInOutBack: function (x, t, b, c, d, s) {
1223            if (s == undefined) {
1224                s = 1.70158;
1225            }
1226            if ((t /= d / 2) < 1) {
1227                return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b;
1228            }
1229            return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b;
1230        },
1231        easeInBounce: function (x, t, b, c, d) { return c - jQuery.easing.easeOutBounce(x, d - t, 0, c, d) + b },
1232        easeOutBounce: function (x, t, b, c, d) {
1233            if ((t /= d) < (1 / 2.75)) {
1234                return c * (7.5625 * t * t) + b;
1235            } else if (t < (2 / 2.75)) {
1236                return c * (7.5625 * (t -= (1.5 / 2.75)) * t + .75) + b;
1237            } else if (t < (2.5 / 2.75)) {
1238                return c * (7.5625 * (t -= (2.25 / 2.75)) * t + .9375) + b;
1239            } else {
1240                return c * (7.5625 * (t -= (2.625 / 2.75)) * t + .984375) + b;
1241            }
1242        },
1243        easeInOutBounce: function (x, t, b, c, d) {
1244            if (t < d / 2) {
1245                return jQuery.easing.easeInBounce(x, t * 2, 0, c, d) * .5 + b;
1246            }
1247            return jQuery.easing.easeOutBounce(x, t * 2 - d, 0, c, d) * .5 + c * .5 + b;
1248        }
1249    });

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.