Skip to content

Commit

Permalink
Webkit browsers return NaN if padding attribute(s) are not set, causi…
Browse files Browse the repository at this point in the history
…ng isotope to stack elements on top of each other instead of positioning correctly.
  • Loading branch information
Ryan Oberholzer committed Mar 20, 2012
1 parent f29b8b0 commit f58d312
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions jquery.isotope.js
Expand Up @@ -395,9 +395,12 @@
this.reloadItems();

// get top left position of where the bricks should be
var _paddingLeft = this.element.css('padding-left');
var _paddingTop = this.element.css('padding-top');

this.offset = {
left: parseInt( this.element.css('padding-left'), 10 ),
top: parseInt( this.element.css('padding-top'), 10 )
left: parseInt( (_paddingLeft ? _paddingLeft : 0), 10 ),
top: parseInt( (_paddingTop ? _paddingTop : 0), 10 )
};

// add isotope class first time around
Expand Down

0 comments on commit f58d312

Please sign in to comment.