miromannino / Justified-Gallery

Javascript library to help creating high quality justified galleries of images. Used by thousands of websites as well as the photography community 500px.
http://miromannino.github.io/Justified-Gallery/
MIT License
1.68k stars 299 forks source link

Fix width/height property access #247

Closed fxkr closed 6 years ago

fxkr commented 6 years ago

parseFloat($image.attr(...)) was always NaN, effectively breaking the waitThumbnailsLoad=false feature. .prop works. (Version 60.0.3112.113 (Official Build) (64-bit) on Fedora 26).

PS: justified-gallery is awesome PPS: Minor criticism: I don't like how you commit generated files, cluttering the history...

kswro commented 6 years ago

I need to revert this commit (or return to 3.6.3) to make 'waitThumbnailsLoad = false' feature work again. Failed to get image width/height value using .prop.

jQuery 3.3.1/2.2.4

fxkr commented 6 years ago

Huh? May I ask which browser and jQuery version you are testing with? I was using Chrome and jQuery v3.2.1, and .prop worked there.

kswro commented 6 years ago

I'm using jQuery 3.3.1 and Chrome 64. But you were right! It looks Justified Gallery 3.6.5 has conflict with foundation.css (ZF 6.4.3). If I remove foundation css, 'waitThumbnailsLoad = false' working again. Weird...

Please take a look at the code: 3.6.5 w/o Foundation (work) = https://codepen.io/kswro/pen/ddLjoG 3.6.5 with Foundation (not work!) = https://codepen.io/kswro/pen/ZrZjmz 3.6.3 with Foundation (work) = https://codepen.io/kswro/pen/GQLGVN

miromannino commented 6 years ago

@fxkr do you have an example where .attr() doesn't work and .prop() does?