Skip to content Skip to sidebar Skip to footer

How Do I Close The Filtrify Panel When Opening Another?

I'm currently using the beautiful Filtrify script of a website of mine with Isotope integration (http://luis-almeida.github.com/filtrify/). On my site I have 4 'categories'/panels

Solution 1:

I do not know in depth the library, but you could try to close the siblings of a panel before opening another panel.

a first approximation of the method could be:

Filtrify.prototype.closeSiblingsPanel = function ( f ) {
    for(var item in this._menu){
        if(item !== f && this._menu[item].panel){
            this._menu[item].panel.addClass("ft-hidden");
            this._menu[item].label.removeClass("ft-opened");
        }
    }
};

you also have to modify the click event handler:

Filtrify.prototype.events = function ( f ) {
    //...
    this._menu[f].label.on("click", this._bind(function(event){
        this.openPanel( f );
        this.closeSiblingsPanel( f );
        this.bringToFront( f );
        event.stopPropagation();
    }, this) );
    //...
};

Post a Comment for "How Do I Close The Filtrify Panel When Opening Another?"