PageSourceSearch

http://www.heinekenchina.com/static_2022/js/jquery.SuperSlide.2.1.3.js

js heinekenchina.com collected 2026-10-05 19:08:57 UTC 48,541 bytes, 1,148 lines download raw bytes

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

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.