Permalink
Browse files

Merge pull request #439 from tschallacka/fix_for_each_loop

Fixed jQuery.each loop
  • Loading branch information...
2 parents e6911c9 + bf0d5a6 commit f36e9d86ccfa57e7f40c81832147deac90cd0a0a @idiot committed on GitHub Aug 28, 2016
Showing with 6 additions and 3 deletions.
  1. +6 −3 src/js/unslider.js
View
@@ -627,9 +627,12 @@
// And set up our jQuery plugin
$.fn.unslider = function(opts) {
- return this.each(function() {
- var $this = $(this);
-
+ return this.each(function(index,elem) {
+ var $this = $(elem);
+ var unslider = $(elem).data('unslider');
+ if(unslider instanceof $.Unslider) {
+ return;
+ }
// Allow usage of .unslider('function_name')
// as well as using .data('unslider') to access the
// main Unslider object

0 comments on commit f36e9d8

Please sign in to comment.