jQuery Isotope - 关闭之前打开的框
我一直在寻找这个问题的答案,但到目前为止还没有运气。我对 jQuery 或 Javascript 毫无了解,所以我为一个简单的答案而绞尽脑汁。
我已经下载了 jQuery Isotope 并计划将其用作画廊。单击另一个框时是否可以自动关闭当前展开的框 - 将前一个框返回到其原始大小?当您单击一个框时,它会展开,然后单击另一个框,它也会展开,第一个框保持展开状态。
预先感谢,
数据库
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 jQuery 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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以向元素(即框)添加和删除“.close”和“.opened”类,或者只是在它们之间切换,请参阅 http://api.jquery.com/toggleClass/ 然后,您可能想使用 $container.isotope('reLayout'); 重新同位素化您的元素。
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');