Search code examples
jquery-isotopejquery-masonry

Start the Isotope with the defined class


I need to start the isotope by displaying only the div's that have the class "destaque".

At the moment, my script when loading, displays all loaded items from CMS, however if I click the filter button:

<li data-filter=".destaque" class="active">Todos</li>

It will display the items I want.

--

How start isotope displying just itens with this class div?


Solution

  • var $gridExperiencia = $('#experiencia-grid').isotope({
            filter: '.destaque',
            itemSelector: '.element-item',
            transitionDuration: '0.7s',
            masonry: {
                gutter: 25
            }
        });
    

    I just use filter: '.destaque',