jQuery Isotope - closing previously opened boxes
I have been searching and searching for an answer to this question but with no luck so far. I have no knowledge of jQuery or Javascript so am pulling my hair out over what could be a simple answer.
I have downloaded j开发者_运维问答Query Isotope and am planning to use it as a gallery. Is it possible to automatically close the current expanded box when another one is clicked - returning the previous box to its original size? At the moment when you click on a box it expands, then you click on another one and it expands, with the first one staying expanded.
Thanks in advance,
DB
You could add and remove classes of ".closed" and ".opened" to your elements, i.e. boxes, or just toggle between them, see http://api.jquery.com/toggleClass/ Then, you probably want to re-isotope your elements with $container.isotope('reLayout');
精彩评论