PageSourceSearch

https://www.dealninja.com/wp-content/themes/couponxxl/js/responsiveslides.min.js?ver=5.7.19

js dealninja.com collected 2026-10-03 00:26:19 UTC 12,400 bytes, 392 lines download raw bytes

1/*! ResponsiveSlides.js v1.54
2 * http://responsiveslides.com
3 * http://viljamis.com
4 *
5 * Copyright (c) 2011-2012 @viljamis
6 * Available under the MIT license
7 */
8
9/*jslint browser: true, sloppy: true, vars: true, plusplus: true, indent: 2 */
10
11(function ($, window, i) {
12  $.fn.responsiveSlides = function (options) {
13
14    // Default settings
15    var settings = $.extend({
16      "auto": true,             // Boolean: Animate automatically, true or false
17      "speed": 500,             // Integer: Speed of the transition, in milliseconds
18      "timeout": 4000,          // Integer: Time between slide transitions, in milliseconds
19      "pager": false,           // Boolean: Show pager, true or false
20      "nav": false,             // Boolean: Show navigation, true or false
21      "random": false,          // Boolean: Randomize the order of the slides, true or false
22      "pause": false,           // Boolean: Pause on hover, true or false
23      "pauseControls": true,    // Boolean: Pause when hovering controls, true or false
24      "prevText": "Previous",   // String: Text for the "previous" button
25      "nextText": "Next",       // String: Text for the "next" button
26      "maxwidth": "",           // Integer: Max-width of the slideshow, in pixels
27      "navContainer": "",       // Selector: Where auto generated controls should be appended to, default is after the <ul>
28      "manualControls": "",     // Selector: Declare custom pager navigation
29      "namespace": "rslides",   // String: change the default namespace used
30      "before": $.noop,         // Function: Before callback
31      "after": $.noop,           // Function: After callback
32      "init": $.noop           // Function: After callback
33    }, options);
34
35    return this.each(function () {
36
37      // Index for namespacing
38      i++;
39
40      var $this = $(this),
41
42        // Local variables
43        vendor,
44        selectTab,
45        startCycle,
46        restartCycle,
47        rotate,
48        $tabs,
49
50        // Helpers
51        index = 0,
52        $slide = $this.children(),
53        length = $slide.size(),
54        fadeTime = parseFloat(settings.speed),
55        waitTime = parseFloat(settings.timeout),
56        maxw = parseFloat(settings.maxwidth),
57
58        // Namespacing
59        namespace = settings.namespace,
60        namespaceIdx = namespace + i,
61
62        // Classes
63        navClass = namespace + "_nav " + namespaceIdx + "_nav",
64        activeClass = namespace + "_here",
65        visibleClass = namespaceIdx + "_on",
66        slideClassPrefix = namespaceIdx + "_s",
67
68        // Pager
69        $pager = $("<ul class='" + namespace + "_tabs " + namespaceIdx + "_tabs' />"),
70
71        // Styles for visible and hidden slides
72        visible = {"float": "left", "position": "relative", "opacity": 1, "zIndex": 2},
73        hidden = {"float": "none", "position": "absolute", "opacity": 0, "zIndex": 1},
74
75        // Detect transition support
76        supportsTransitions = (function () {
77          var docBody = document.body || document.documentElement;
78          var styles = docBody.style;
79          var prop = "transition";
80          if (typeof styles[prop] === "string") {
81            return true;
82          }
83          // Tests for vendor specific prop
84          vendor = ["Moz", "Webkit", "Khtml", "O", "ms"];
85          prop = prop.charAt(0).toUpperCase() + prop.substr(1);
86          var i;
87          for (i = 0; i < vendor.length; i++) {
88            if (typeof styles[vendor[i] + prop] === "string") {
89              return true;
90            }
91          }
92          return false;
93        })(),
94
95        // Fading animation
96        slideTo = function (idx) {
97          settings.before(idx);
98          // If CSS3 transitions are supported
99          if (supportsTransitions) {
100            $slide
101              .removeClass(visibleClass)
102              .css(hidden)
103              .eq(idx)
104              .addClass(visibleClass)
105              .css(visible);
106            index = idx;
107            setTimeout(function () {
108              settings.after(idx);
109            }, fadeTime);
110          // If not, use jQuery fallback
111          } else {
112            $slide              
113              .fadeOut(fadeTime, function () {
114                $(this)
115                  .removeClass(visibleClass)
116                  .css(hidden)
117                  .css("opacity", 1);
118              })              
119              .eq(idx)
120              .fadeIn(fadeTime, function () {
121                $(this)
122                  .addClass(visibleClass)
123                  .css(visible);
124                settings.after(idx);
125                index = idx;
126              });
127          }
128        };
129
130      // Random order
131      if (settings.random) {
132        $slide.sort(function () {
133          return (Math.round(Math.random()) - 0.5);
134        });
135        $this
136          .empty()
137          .append($slide);
138      }
139
140      // Add ID's to each slide
141      $slide.each(function (i) {
142        this.id = slideClassPrefix + i;
143      });
144
145      // Add max-width and classes
146      $this.addClass(namespace + " " + namespaceIdx);
147      if (options && options.maxwidth) {
148        $this.css("max-width", maxw);
149      }
150
151      // Hide all slides, then show first one
152      $slide
153        .hide()
154        .css(hidden)
155        .eq(0)
156        .addClass(visibleClass)
157        .css(visible)
158        .show();
159      // CSS transitions
160      if (supportsTransitions) {
161        $slide
162          .show()
163          .css({
164            // -ms prefix isn't needed as IE10 uses prefix free version
165            "-webkit-transition": "opacity " + fadeTime + "ms ease-in-out",
166            "-moz-transition": "opacity " + fadeTime + "ms ease-in-out",
167            "-o-transition": "opacity " + fadeTime + "ms ease-in-out",
168            "transition": "opacity " + fadeTime + "ms ease-in-out"
169          });
170      }
171      setTimeout(function(){
172        settings.init();
173      }, fadeTime)
174      // Only run if there's more than one slide
175      if ($slide.size() > 1) {
176
177        // Make sure the timeout is at least 100ms longer than the fade
178        if (waitTime < fadeTime + 100) {
179          return;
180        }
181
182        // Pager
183        if (settings.pager && !settings.manualControls) {
184          var tabMarkup = [];
185          $slide.each(function (i) {
186            var n = i + 1;
187            tabMarkup +=
188              "<li>" +
189              "<a href='#' class='" + slideClassPrefix + n + "'>" + n + "</a>" +
190              "</li>";
191          });
192          $pager.append(tabMarkup);
193
194          // Inject pager
195          if (options.navContainer) {
196            $(settings.navContainer).append($pager);
197          } else {
198            $this.after($pager);
199          }
200        }
201
202        // Manual pager controls
203        if (settings.manualControls) {
204          $pager = $(settings.manualControls);
205          $pager.addClass(namespace + "_tabs " + namespaceIdx + "_tabs");
206        }
207
208        // Add pager slide class prefixes
209        if (settings.pager || settings.manualControls) {
210          $pager.find('li').each(function (i) {
211            $(this).addClass(slideClassPrefix + (i + 1));
212          });
213        }
214
215        // If we have a pager, we need to set up the selectTab function
216        if (settings.pager || settings.manualControls) {
217          $tabs = $pager.find('a');
218
219          // Select pager item
220          selectTab = function (idx) {
221            $tabs
222              .closest("li")
223              .removeClass(activeClass)
224              .eq(idx)
225              .addClass(activeClass);
226          };
227        }
228
229        // Auto cycle
230        if (settings.auto) {
231
232          startCycle = function () {
233            rotate = setInterval(function () {
234
235              // Clear the event queue
236              $slide.stop(true, true);
237
238              var idx = index + 1 < length ? index + 1 : 0;
239
240              // Remove active state and set new if pager is set
241              if (settings.pager || settings.manualControls) {
242                selectTab(idx);
243              }
244
245              slideTo(idx);
246            }, waitTime);
247          };
248
249          // Init cycle
250          startCycle();
251        }
252
253        // Restarting cycle
254        restartCycle = function () {
255          if (settings.auto) {
256            // Stop
257            clearInterval(rotate);
258            // Restart
259            startCycle();
260          }
261        };
262
263        // Pause on hover
264        if (settings.pause) {
265          $this.hover(function () {
266            clearInterval(rotate);
267          }, function () {
268            restartCycle();
269          });
270        }
271
272        // Pager click event handler
273        if (settings.pager || settings.manualControls) {
274          $tabs.bind("click", function (e) {
275            e.preventDefault();
276
277            if (!settings.pauseControls) {
278              restartCycle();
279            }
280
281            // Get index of clicked tab
282            var idx = $tabs.index(this);
283
284            // Break if element is already active or currently animated
285            if (index === idx || $("." + visibleClass).queue('fx').length) {
286              return;
287            }
288
289            // Remove active state from old tab and set new one
290            selectTab(idx);
291
292            // Do the animation
293            slideTo(idx);
294          })
295            .eq(0)
296            .closest("li")
297            .addClass(activeClass);
298
299          // Pause when hovering pager
300          if (settings.pauseControls) {
301            $tabs.hover(function () {
302              clearInterval(rotate);
303            }, function () {
304              restartCycle();
305            });
306          }
307        }
308
309        // Navigation
310        if (settings.nav) {
311          var navMarkup =
312            "<a href='#' class='" + navClass + " prev'>" + settings.prevText + "</a>" +
313            "<a href='#' class='" + navClass + " next'>" + settings.nextText + "</a>";
314
315          // Inject navigation
316          if (options.navContainer) {
317            $(settings.navContainer).append(navMarkup);
318          } else {
319            $this.append(navMarkup);
320          }
321
322          var $trigger = $("." + namespaceIdx + "_nav"),
323            $prev = $trigger.filter(".prev");
324
325          // Click event handler
326          $trigger.bind("click", function (e) {
327            e.preventDefault();
328
329            var $visibleClass = $("." + visibleClass);
330
331            // Prevent clicking if currently animated
332            if ($visibleClass.queue('fx').length) {
333              return;
334            }
335
336            //  Adds active class during slide animation
337            //  $(this)
338            //    .addClass(namespace + "_active")
339            //    .delay(fadeTime)
340            //    .queue(function (next) {
341            //      $(this).removeClass(namespace + "_active");
342            //      next();
343            //  });
344
345            // Determine where to slide
346            var idx = $slide.index($visibleClass),
347              prevIdx = idx - 1,
348              nextIdx = idx + 1 < length ? index + 1 : 0;
349
350            // Go to slide
351            slideTo($(this)[0] === $prev[0] ? prevIdx : nextIdx);
352            if (settings.pager || settings.manualControls) {
353              selectTab($(this)[0] === $prev[0] ? prevIdx : nextIdx);
354            }
355
356            if (!settings.pauseControls) {
357              restartCycle();
358            }
359          });
360
361          // Pause when hovering navigation
362          if (settings.pauseControls) {
363            $trigger.hover(function () {
364              clearInterval(rotate);
365            }, function () {
366              restartCycle();
367            });
368          }
369        }
370
371      }
372
373      // Max-width fallback
374      if (typeof document.body.style.maxWidth === "undefined" && options.maxwidth) {
375        var widthSupport = function () {
376          $this.css("width", "100%");
377          if ($this.width() > maxw) {
378            $this.css("width", maxw);
379          }
380        };
381
382        // Init fallback
383        widthSupport();
384        $(window).bind("resize", function () {
385          widthSupport();
386        });
387      }
388
389    });
390
391  };
392})(jQuery, this, 0);

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.