HTMLify
setting.js
Views: 8 | Author: cody
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | jQuery(document).ready(function($){ if (jQuery().quicksand) { // Clone applications to get a second collection var $data = $(".portfolio").clone(); //NOTE: Only filter on the main portfolio page, not on the subcategory pages $('.filter li').click(function(e) { $(".filter li").removeClass("active"); // Use the last category class as the category to filter by. This means that multiple categories are not supported (yet) var filterClass=$(this).attr('class').split(' ').slice(-1)[0]; if (filterClass == 'all') { var $filteredData = $data.find('.item-thumbs'); } else { var $filteredData = $data.find('.item-thumbs[data-type=' + filterClass + ']'); } $(".portfolio").quicksand($filteredData, { duration: 600, adjustHeight: 'auto' }, function () { // Portfolio fancybox $(".fancybox").fancybox({ padding : 0, beforeShow: function () { this.title = $(this.element).attr('title'); this.title = '<h4>' + this.title + '</h4>' + '<p>' + $(this.element).parent().find('img').attr('alt') + '</p>'; }, helpers : { title : { type: 'inside' }, } }); }); $(this).addClass("active"); return false; }); }//if quicksand }); |