germanysbestkeptsecret / Wookmark-jQuery

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

can wookmark provide a plugin that tells when its done? #186

Closed ninabreznik closed 9 years ago

ninabreznik commented 9 years ago

In order to see boxes with pictures, wookmark needs to run. After...

var handler = $('.box');
handler.wookmark(options);

...the boxes overlap because images have their height not set. If i measure the height with javascript and set the , then executing wookmark again fixes the problem.

PROBLEM: handler.wookmark(options); seems to run async, so sometimes the javascript runs, when boxes with images are not visible yet and measures a height of 0 and sets it on the tag.

This can be hacked around by using setTimeout(...)and waiting a bit for wookmark to finish before measuring the height.

Can wookmark PLEASE support a callback to tell when its done finishing whatever its doing, so that i can do whatever i need to do? That would be awesome.

Sebobo commented 9 years ago

Hi,

there are several examples which use the imagesLoaded plugin. This plugin does what you need.

ninabreznik commented 9 years ago

Thanks a lot for your answer. I will give it a try :)

Sebobo commented 9 years ago

Will close this. Please reopen if you still need help.