1/*----------------------------------------------------------------------------------- 2 3 Custom JS - All front-end jQuery 4 5-----------------------------------------------------------------------------------*/ 6 7jQuery(document).ready(function() { 8 9 function portfolio_quicksand() { 10 11 // Setting Up Our Variables 12 var jQueryfilter; 13 var jQuerycontainer; 14 var jQuerycontainerClone; 15 var jQueryfilterLink; 16 var jQueryfilteredItems 17 18 // Set Our Filter 19 jQueryfilter = jQuery('.gal-filter li.active a').attr('class'); 20 21 // Set Our Filter Link 22 jQueryfilterLink = jQuery('.gal-filter li a'); 23 24 // Set Our Container 25 jQuerycontainer = jQuery('.filterable-grid'); 26 27 // Clone Our Container 28 jQuerycontainerClone = jQuerycontainer.clone(); 29 30 // Apply our Quicksand to work on a click function 31 // for each for the filter li link elements 32 jQueryfilterLink.click(function(e) 33 { 34 // Remove the active class 35 jQuery('.gal-filter li').removeClass('active'); 36 37 // Split each of the filter elements and override our filter 38 jQueryfilter = jQuery(this).attr('class').split(' '); 39 40 // Apply the 'active' class to the clicked link 41 jQuery(this).parent().addClass('active'); 42 43 // If 'all' is selected, display all elements 44 // else output all items referenced to the data-type 45 if (jQueryfilter == 'all') { 46 jQueryfilteredItems = jQuerycontainerClone.find('.gal-image'); 47 } 48 else { 49 jQueryfilteredItems = jQuerycontainerClone.find('.gal-image[data-type~=' + jQueryfilter + ']'); 50 } 51 52 // Finally call the Quicksand function 53 jQuerycontainer.quicksand(jQueryfilteredItems, 54 { 55 // The Duration for animation 56 duration: 500000, 57 // the easing effect when animation 58 easing: 'easeInOutQuad', 59 adjustWidth: 'dyanamic', 60 maxWidth: 0, 61 enhancement: function() { 62 // jQuery('.one-fourth').width(222); 63 } 64 // height adjustment becomes dynamic 65 ////adjustHeight: 'auto', 66 //retainExisting: false 67 }); 68 69 //Initalize our PrettyPhoto Script When Filtered 70 jQuerycontainer.quicksand(jQueryfilteredItems, 71 function () { fancybox(); } 72 ); 73 }); 74 } 75 76 if(jQuery().quicksand) { 77 portfolio_quicksand(); 78 } 79 80 function fancybox() { 81 // Apply PrettyPhoto to find the relation with our portfolio item 82 jQuery('a.gallery-fancybox').fancybox 83 ({ 84 'transitionIn' : 'none', 85 'transitionOut' : 'none', 86 'titlePosition' : 'over', 87 'titleFormat' : function(title, currentArray, currentIndex, currentOpts) 88 { 89 return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' ' + title : '') + '</span>'; 90 } 91 }); 92 } 93 94 //if(jQuery().prettyPhoto) { 95 // lightbox(); 96 //} 97 98 99}); // END OF DOCUMENT
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.