0

次の同位体の実装を使用して、3 つの選択メニューを使用して、タグでフィルター処理する同位体グリッドを wordpress サイトに含めています。これはすべてうまく機能しますが、BBQ プラグインを追加して、他のページから事前定義されたフィルターにリンクできるようにするためのガイダンスを誰か教えてください。いくつかのバリエーションを試しましたが、BBQ と一緒に既存のコードを使用する方法がわかりません。助けてくれてありがとう!

jQuery(function ($) {

var $container = $('#isotope-list'); //The ID for the list with all the blog posts
$container.isotope({ //Isotope options, 'item' matches the class in the PHP
    itemSelector : '.item', 
    layoutMode : 'fitRows',

});

//Add the class selected to the item that is clicked, and remove from the others
var $optionSets = $('.group'),
$optionLinks = $optionSets.find('option');

$optionLinks.click(function(){
var $this = $(this);
// don't proceed if already selected
if ( $this.hasClass('selected') ) {
  return false;
}
var $optionSet = $this.parents('.group');
$optionSets.find('.selected').removeClass('selected');
$this.addClass('selected');

//When an item is clicked, sort the items.
 var selector = $(this).attr('data-filter');
$container.isotope({ filter: selector });

return false;
});

});
4

0 に答える 0