diff --git a/src/gridstack.js b/src/gridstack.js index cdf2d13..e6e50e8 100644 --- a/src/gridstack.js +++ b/src/gridstack.js @@ -1494,8 +1494,8 @@ }; GridStack.prototype.cellWidth = function() { - var o = this.container.children('.' + this.opts.itemClass).first(); - return Math.ceil(o.outerWidth() / parseInt(o.attr('data-gs-width'), 10)); + var o = $(this.container); + return Math.ceil(o.outerWidth() / o.attr('data-gs-width')); }; GridStack.prototype.getCellFromPixel = function(position, useOffset) {