Isotope Metafizzy: How to check if an element has already been initialized as an isotope container?

javascript, jquery, jquery-isotope

Solution

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
}

Problem

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!

Original source