开发者

jQuery Isotope - closing previously opened boxes

开发者 https://www.devze.com 2023-03-28 21:12 出处:网络
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 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');

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号