我有jquery同位素設置並創建了一些過濾器。當我創建我選擇一個過濾器,同位素做一個不錯的小動畫。我想在動畫結尾處觸發警報。jquery同位素過濾器完成後觸發警報
這個例子演示功能時出現的動畫:
http://isotope.metafizzy.co/demos/filtering.html
任何想法?
下面是代碼過濾器上的點擊:
$('.filter').on('click', 'a', function(event) {
event.preventDefault();
var $this = $(this);
// don't proceed if already selected
if ($this.hasClass('selected')) {
return false;
}
// console.log('hello world');
var $optionSet = $this.parents('.option-set');
var group = $optionSet.attr('data-filter-group');
options.comboFilters[ group ] = $this.attr('data-filter-value');
$.bbq.pushState(options);
// COUNT
var $filtered = $('#isotope-container').data('isotope').$filteredAtoms;
// get count of all filtered item
alert($filtered.length);
// get count of all filtered items that match a selector
//$filtered.filter('.blue').length;
});
這可能有所幫助:http://stackoverflow.com/questions/5433862/callback-for-jquery-plugin-isotope – Johan