germanysbestkeptsecret / Wookmark-jQuery

A jQuery plugin to create a dynamic, multi-column layout.
MIT License
2.64k stars 759 forks source link

Wookmark ItemHeight Bug in Firefox #232

Open HoloBack opened 6 years ago

HoloBack commented 6 years ago

There is a bug in version 2.x in connection with the ItemHeight when using Firefox (Flexible Width, Height: auto). I guess, it has to do with the Fractional Pixel Calculation in Firefox.

F.e. you have an item with a height (computed) of 532.5px, you add a vertical offset of 1px, then the plugin calculates a rounded ItemHeight of 533px and the element which comes below gets a top value of 534px - This works in Safari & Chrome (tested), but not in Firefox. Firefox might not round the height to 533px and so the element below needs a top value of 533.5px to guarantee the vertical offset of 1px. Changing the top value in the dev console to 533.5px, solves the issue, so I assume, it has to do with the height calculation.

Note: Wookmark version 1.x uses $.outerheight() for the height calculation, which returns a float value, while version 2.x uses item.offsetHeight which returns an integer value.