この最初の質問をするのは、次のコードにかなりこだわっているためです。
基本的に:特定のコンテンツに基づいて、div をフィルタリングして、div の表示を切り替えたいと思います。各 div には、いくつかの「タグ」が含まれています。「タグ」をクリックすると、同じ「タグ」を含む div のみが表示されます。と言うとシンプルに見えます。
しかし、私はアイソトープ div コンテナー内で実行しています。さらに重要なことは、外部タグ メニューがないため、トリガーはトグルされる div のすぐ内側にあります。
私は 2 つのパスに直面しています:
$container.isoSelective({
linkSelector: '.filter', // this is the filter link
attrSelector: 'rel', // the attribute containing the filter
activeClass: 'selected' // class to add to selected
});
しかし、トリガーがターゲット内にある場合、満足していないようです。
私が既存の JSFiddle コードで行ったフォークは、素晴らしい動作をしますが、今までアイソトープ内で実行することはできません:
—————</p>
そして最後に、htmlページの私のコードからの抜粋です:
<div class="articlesBlock">
<div class="blockBox">
<a href="#"><p>Lorem ipsum paragraph.</p></a>
<em><a class='filter base-first-tag' rel='.first-tag' href='#'>The Base First Tag</a></em>
<em><a class='filter second-tag' rel='.second-tag' href='#'>The Second Tag</a></em>
<em><a class='filter third-tag' rel='.third-tag' href='#'> The Third Tag</a></em>
</div>
</div>
<div class="articlesBlock">
<div class="blockBox">
<a href="#"><p>Lorem ipsum paragraph.</p></a>
<em><a class='filter base-first-tag' rel='.base-first-tag' href='#'>The First also Base Tag</a</em>
<em><a class='filter second-tag' rel='.second-tag' href='#'>The Second Tag</a></em>
<em><a class='filter third-tag' rel='.third-tag' href='#'> The Third Tag</a></em>
</div>
</div>
<div class="articlesBlock">
<div class="blockBox">
<a href="#"><p>Lorem ipsum paragraph.</p></a>
<em><a class='filter first-tag' rel='.first-tag' href='#'>The First Tag</a></em>
<em><a class='filter second-new-tag' rel='.second-new-tag' href='#'>The New Second Tag</a></em>
<em><a class='filter third-tag' rel='.third-tag' href='#'> The Third Tag</a></em>
</div>
</div>
以下は IsoSelective アプローチを使用した JSFiddle ですが、それでも機能しません。
どう思いますか ?
ありがとう