user948557
user948557

Reputation: 43

jquery isotope load

I using isotope plugin for jquery, this works good if is static html blocks:

HTML:

<body>
    <div id="target">
        <div></div>
        <div></div>
        <div></div>
        <div></div>
    </div>
</body>

JS:

$('#target > *').isotope([needle options]);

but, if i use "load" to load content into #target, isotope ignore them.

JS:
$('#target').load('file',function()
{
    $('#target > *').isotope([needle options]);
}
);

please help, it's very important.

Upvotes: 0

Views: 1304

Answers (1)

Tim
Tim

Reputation: 9489

You can instance onload various div items retrieved by your load.

See insert method from the isotope docs.

$.ajax({
  url: file,
  success: function( data ) {
  $('#target').isotope('insert', data);
  }
});

Upvotes: 2

Related Questions