Skip to content

Commit

Permalink
Replace .size() with .length to be compatible with jQuery 3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
jsor committed May 20, 2016
1 parent 8e3df57 commit 52e4a5d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions lib/jquery.jcarousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@
this.clip = this.container.find('.jcarousel-clip');
}

if (this.clip.size() === 0) {
if (this.clip.length === 0) {
this.clip = this.list.wrap('<div></div>').parent();
}

if (this.container.size() === 0) {
if (this.container.length === 0) {
this.container = this.clip.wrap('<div></div>').parent();
}

Expand All @@ -116,15 +116,15 @@

this.buttonPrev = $('.jcarousel-prev', this.container);

if (this.buttonPrev.size() === 0 && this.options.buttonPrevHTML !== null) {
if (this.buttonPrev.length === 0 && this.options.buttonPrevHTML !== null) {
this.buttonPrev = $(this.options.buttonPrevHTML).appendTo(this.container);
}

this.buttonPrev.addClass(this.className('jcarousel-prev'));

this.buttonNext = $('.jcarousel-next', this.container);

if (this.buttonNext.size() === 0 && this.options.buttonNextHTML !== null) {
if (this.buttonNext.length === 0 && this.options.buttonNextHTML !== null) {
this.buttonNext = $(this.options.buttonNextHTML).appendTo(this.container);
}

Expand Down Expand Up @@ -155,7 +155,7 @@

var self = this;

if (li.size() > 0) {
if (li.length > 0) {
var wh = 0, j = this.options.offset;
li.each(function() {
self.format(this, j++);
Expand All @@ -166,7 +166,7 @@

// Only set if not explicitly passed as option
if (!o || o.size === undefined) {
this.options.size = li.size();
this.options.size = li.length;
}
}

Expand Down Expand Up @@ -837,7 +837,7 @@

var self = this;

if (this.buttonNext.size() > 0) {
if (this.buttonNext.length > 0) {
this.buttonNext.unbind(this.options.buttonNextEvent + '.jcarousel', this.funcNext);

if (n) {
Expand All @@ -855,7 +855,7 @@
}
}

if (this.buttonPrev.size() > 0) {
if (this.buttonPrev.length > 0) {
this.buttonPrev.unbind(this.options.buttonPrevEvent + '.jcarousel', this.funcPrev);

if (p) {
Expand Down
Loading

0 comments on commit 52e4a5d

Please sign in to comment.