From 2221e8592a40947c5a77a22de31a6fdd569f33a1 Mon Sep 17 00:00:00 2001 From: "Angelo Galleja (ga.n)" Date: Wed, 27 Sep 2017 23:16:53 +0200 Subject: [PATCH] Update jquery.pageguide.js adapted code to support jQuery 3.0+ changed $().size() to $().length .size() was deprecated in jQuery 1.8 and removed in jQuery 3.0 see http://api.jquery.com/size/ for more details --- js/jquery.pageguide.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/js/jquery.pageguide.js b/js/jquery.pageguide.js index cfbeb38..f485b2a 100644 --- a/js/jquery.pageguide.js +++ b/js/jquery.pageguide.js @@ -348,7 +348,7 @@ $guide = (typeof guide === 'string') ? $(guide) : null; if ($guide) { - if (!$guide.size()) return this; + if (!$guide.length) return this; guide = { title: $guide.data('tourtitle'), @@ -370,7 +370,7 @@ guide.steps.push(step); }); } else { - $guide = ((guide.id && $('#' + guide.id).size()) ? $('#' + guide.id).empty() : $('
    ', { + $guide = ((guide.id && $('#' + guide.id).length) ? $('#' + guide.id).empty() : $('
      ', { id: guide.id || 'pageGuide' + PageGuide.uid(), 'class': 'pageguide-guide' })).data('tourtitle', guide.title); @@ -516,7 +516,7 @@ * If -n < x < 0, then the result of x % n will be x, which is * negative. To get a positive remainder, compute (x + n) % n. */ - var newIdx = (this.curIdx + this.$visibleItems.size() - 1) % this.$visibleItems.size(); + var newIdx = (this.curIdx + this.$visibleItems.length - 1) % this.$visibleItems.length; this.$wrapper.trigger('previous.pageguide'); this.showStep(newIdx, 1); @@ -532,7 +532,7 @@ next: function() { if (!$('body').is('.pageguide-open')) return this; - var newIdx = (this.curIdx + 1) % this.$visibleItems.size(); + var newIdx = (this.curIdx + 1) % this.$visibleItems.length; this.$wrapper.trigger('next.pageguide'); this.showStep(newIdx, -1); @@ -870,7 +870,7 @@ $(this).data('idx', i); }); - if ((this.settings.autoAdvanceInterval || this.settings.autoStart) && this.$visibleItems.size() > 0) { + if ((this.settings.autoAdvanceInterval || this.settings.autoStart) && this.$visibleItems.length > 0) { if (this.settings.autoStartDelay) { setTimeout($.proxy(function () { this.showStep(0); @@ -977,4 +977,4 @@ return pg ? pg.load(fn, options) : (pg = new PageGuide(fn, options)); }; -})); \ No newline at end of file +}));