Tomm Armstrong
Tomm Armstrong

Reputation: 133

Disable jQuery Masonry

I'm trying to disable jQuery masonry for certain states of a page on my site but can't seem to find a way to do it. Do you know how I could do this? Thanks.

Upvotes: 6

Views: 5527

Answers (2)

user2112274
user2112274

Reputation:

I used @kaverzniy's answer but wrapped it in

var container = $('#container'); // or whatever your container is
if(container.masonry()) {
    $('#masonry').masonry( 'destroy' );
}

to avoid calling methods on masonry prior to initialization (in case it hadn't been initialized yet).

Upvotes: 2

Luke
Luke

Reputation: 340

Here is the list of methods http://desandro.github.io/masonry/docs/methods.html#content

Assuming your Masonry container ID is #masonry

$('#masonry').masonry( 'destroy' );

Upvotes: 8

Related Questions