Two questions, everybody:
1) How do I toggle Isotope on and off?
2) How do I toggle layout modes? That is, how do I go from this:
$('.content').isotope({ itemSelector : '.hentry',
layoutMode : 'cellsByRow',
cellsByRow : { columnWidth : 240, rowHeight : 360 } });
to this:
$('.content').isotope({ itemSelector : '.hentry',
layoutMode : 'masonry'});
with a simple click switch? Any ideas?
Thanks!
See http://jsfiddle.net/desandro/dbgFa/
1) To disable Isotope after initializing it, use the destroy method
$('.content').isotope('destroy')
Then turn it back on by triggering Isotope again
$('.content').isotope( /* options */ )
2) You would change layout modes just like your example code, by setting the layoutMode in the options. This will also trigger a re-layout and the layout will change.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With