0

私は現在、Isotope を統合した私の Web サイトの美しい Filtrify スクリプトを使用しています (http://luis-almeida.github.com/filtrify/)。

私のサイトには、フィールドを検索するための 4 つの「カテゴリ」/パネルがあります。最初のカテゴリ/パネルを開いてマウスを次のカテゴリに移動して開くと、最初のカテゴリがまだ開いています。CSS または Javascript を使用して、次のカテゴリ/ボタンにカーソルを合わせて別の Filtrify パネルを開くときに、開いている Filtrify パネルを閉じることはできますか? それらをすべて開いても、今は開いたままです。例として、ここで「ジャンル」、「主な俳優」、「監督」を開きます: http://luis-almeida.github.com/filtrify/movies.html

あなたの助けに本当に感謝します! アドバイスありがとうございます!

4

1 に答える 1

3

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) );
    //...
};
于 2013-01-09T11:42:05.007 に答える