admin管理员组文章数量:1192921
The plugin: /
I would like to be able to check if an element has already been initialized as an isotope container. EG the follow code will result in an error message if the element has not:
$(".div-class").isotope('destroy')
Yields:
cannot call methods on isotope prior to initialization; attempted to call method 'destroy'
I would like to be able to write something like:
if ($(".div-class").isotope('already-initialized')) {
// some other code
}
I can't find such a method on isotope docs yet. Any help would be appreciated!
The plugin: http://isotope.metafizzy.co/
I would like to be able to check if an element has already been initialized as an isotope container. EG the follow code will result in an error message if the element has not:
$(".div-class").isotope('destroy')
Yields:
cannot call methods on isotope prior to initialization; attempted to call method 'destroy'
I would like to be able to write something like:
if ($(".div-class").isotope('already-initialized')) {
// some other code
}
I can't find such a method on isotope docs yet. Any help would be appreciated!
Share Improve this question asked Apr 22, 2013 at 2:08 jayjay 12.5k16 gold badges66 silver badges104 bronze badges2 Answers
Reset to default 25That class is no longer added by isotope. I solved it like this:
if($(".div-class").data('isotope')) {
}
Since I notice this plugin would add a isotope
class to the container, you can try this code:
if ($(".div-class").hasClass('isotope')) {
// some other code
}
本文标签:
版权声明:本文标题:javascript - Isotope Metafizzy: How to check if an element has already been initialized as an isotope container? - Stack Overflo 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738430513a2086373.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论