Browse Source

Webkit browsers return NaN if padding attribute(s) are not set, causing isotope to stack elements on top of each other instead of positioning correctly.

pull/166/head
Ryan Oberholzer 13 years ago
parent
commit
f58d31260d
  1. 7
      jquery.isotope.js

7
jquery.isotope.js

@ -395,9 +395,12 @@
this.reloadItems(); this.reloadItems();
// get top left position of where the bricks should be // 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 = { this.offset = {
left: parseInt( this.element.css('padding-left'), 10 ), left: parseInt( (_paddingLeft ? _paddingLeft : 0), 10 ),
top: parseInt( this.element.css('padding-top'), 10 ) top: parseInt( (_paddingTop ? _paddingTop : 0), 10 )
}; };
// add isotope class first time around // add isotope class first time around

Loading…
Cancel
Save