Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Isotope Reset All Filters #19

Open
gabrielhuerta opened this issue Dec 24, 2012 · 1 comment
Open

Isotope Reset All Filters #19

gabrielhuerta opened this issue Dec 24, 2012 · 1 comment

Comments

@gabrielhuerta
Copy link

I did not find any documentation about implementing a reset trigger in Isotope so I thought I would share how I got it to work.

Initially I could not get ft.reset(); to work until I finally added var ft = back in. It is absent from the javascript shown in the original Isotope example

 
   var ft =  $.filtrify("container", "placeHolder", {
        hide     : false,
        callback : function ( query, match, mismatch ) {
            container.isotope({ filter : $(match) });
        if ( mismatch.length ) $("div#reset").show();
            else $("div#reset").hide();
        }
    });
     
    $("div#reset > span").click(function() {
        ft.reset();
    });

Thanks for the plugin Luis!

@povilas123
Copy link

Hello
i make like this, and it's works

$(function() {

var container = $("#container");

container.isotope({
    itemSelector : 'ul#container > li',
    layoutMode : 'fitRows'
});

var ft = $.filtrify("container", "placeHolder", {
close : true,
    hide     : false,
    callback : function ( query, match, mismatch ) {
        container.isotope({ filter : $(match) });
                    if ( mismatch.length ) $("div#reset").show();
        else $("div#reset").hide();
    }
});
    $("div#reset span").click(function() {
    ft.reset();
});

});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants