1/* START CUSTOM JQUERY =================================================================== */ 2 3jQuery(document).ready(function(){ 4 5/*----------------------------------*/ 6/* Navigation 7/*----------------------------------*/ 8 9 jQuery('ul.sf-menu').supersubs({ 10 minWidth: 14, 11 maxWidth: 28, 12 extraWidth: 1 13 }).superfish({ 14 delay: 0, 15 speed: 'fast', 16 disableHI: true, 17 animation: {opacity:'show', height:'show'} 18 }); 19 20 var $responsive_nav = jQuery("<select />"); 21 jQuery("<option />", {"selected": "selected", "value": "", "text": "Select a page"}).appendTo($responsive_nav); 22 $responsive_nav.appendTo(".navigation-wrapper"); 23 24 jQuery(".navigation-wrapper ul li a").each(function(){ 25 var nav_url = jQuery(this).attr("href"); 26 var nav_text = jQuery(this).text(); 27 if (jQuery(this).parents("li").length == 2) { nav_text = '- ' + nav_text; } 28 if (jQuery(this).parents("li").length == 3) { nav_text = "-- " + nav_text; } 29 if (jQuery(this).parents("li").length > 3) { nav_text = "--- " + nav_text; } 30 jQuery("<option />", {"value": nav_url, "text": nav_text}).appendTo($responsive_nav) 31 }) 32 33 field_id = ".navigation-wrapper select"; 34 jQuery(field_id).change(function() 35 { 36 value = jQuery(this).attr('value'); 37 window.location = value; 38 }); 39 40 // Navigation Icons 41 jQuery(".navigation-wrapper ul li a").each(function() { 42 jQuery(this).prepend('<span></span>') 43 }); 44 45/*----------------------------------*/ 46/* Gallery Shortcode 47/*----------------------------------*/ 48 49 jQuery('.gallery').each(function(){ 50 jQuery(this).addClass('image-overlay'); 51 }); 52 jQuery('.gallery .gallery-icon a').each(function(){ 53 jQuery(this).addClass('fancybox-gallery'); 54 }); 55 jQuery('.gallery dl dt a').each(function(){ 56 jQuery(this).attr('data-fancybox-group','gallery').append('<span><i class="icon-pictures"></i></span>'); 57 }); 58 59/*----------------------------------*/ 60/* Image overlays 61/*----------------------------------*/ 62 63 jQuery('.image-overlay span').css({ opacity: 0 }); 64 jQuery('.image-overlay span').bind('mouseenter',function(){ 65 jQuery(this).stop(true).animate({ 'opacity': 1 }, 300).andSelf() 66 }).bind('mouseleave',function(){ 67 jQuery(this).stop(true).animate({ 'opacity': 0 }, 200).andSelf() 68 }); 69 70 jQuery(".flickr_badge_image a").each(function() { 71 jQuery(this).addClass('image-overlay').append('<span><i class="icon-link"></i></span>'); 72 }); 73 74/*----------------------------------*/ 75/* Fancybox plugin 76/*----------------------------------*/ 77 78 jQuery('.fancybox').fancybox(); 79 80 jQuery('.fancybox-gallery').fancybox({ 81 openEffect : 'none', 82 closeEffect : 'none', 83 prevEffect : 'none', 84 nextEffect : 'none', 85 closeBtn : false, 86 helpers : { 87 buttons : {} 88 }, 89 afterLoad : function() { 90 this.title = (this.index + 1) + ' / ' + this.group.length + (this.title ? ' - ' + this.title : ''); 91 } 92 }); 93 94 jQuery('.fancybox-media').attr('rel', 'media-gallery').fancybox({ 95 openEffect : 'none', 96 closeEffect : 'none', 97 prevEffect : 'none', 98 nextEffect : 'none', 99 arrows : false, 100 helpers : { 101 media : {}, 102 buttons : {} 103 } 104 }); 105 106/*----------------------------------*/ 107/* FitVids plugin 108/*----------------------------------*/ 109 110 jQuery(".container").fitVids(); 111 112/*----------------------------------*/ 113/* Scroll To Top 114/*----------------------------------*/ 115 116 jQuery(document).ready(function() { 117 jQuery().UItoTop({ easingType: 'easeOutExpo' }); 118 }); 119 120/*----------------------------------*/ 121/* Alerts 122/*----------------------------------*/ 123 124 jQuery('.mt-alert .closeit').click(function(e) { 125 e.preventDefault(); 126 jQuery(this).parent().slideUp(); 127 }); 128 129/*----------------------------------*/ 130/* Responsive table 131/*----------------------------------*/ 132 133 var switched = false; 134 var updateTables = function() { 135 if ((jQuery(window).width() < 959) && !switched ){ 136 switched = true; 137 jQuery("table.responsive-table").each(function(i, element) { 138 splitTable(jQuery(element)); 139 }); 140 return true; 141 } 142 else if (switched && (jQuery(window).width() > 959)) { 143 switched = false; 144 jQuery("table.responsive-table").each(function(i, element) { 145 unsplitTable(jQuery(element)); 146 }); 147 } 148 }; 149 150 jQuery(window).load(updateTables); 151 jQuery(window).bind("resize", updateTables); 152 153 function splitTable(original) 154 { 155 original.wrap("<div class='table-wrapper' />"); 156 157 var copy = original.clone(); 158 copy.find("td:not(:first-child), th:not(:first-child)").css("display", "none"); 159 copy.removeClass("responsive-table"); 160 161 original.closest(".table-wrapper").append(copy); 162 copy.wrap("<div class='pinned' />"); 163 original.wrap("<div class='scrollable' />"); 164 } 165 166 function unsplitTable(original) { 167 original.closest(".table-wrapper").find(".pinned").remove(); 168 original.unwrap(); 169 original.unwrap(); 170 } 171 172/*----------------------------------*/ 173/* Portfolio Filterable 174/*----------------------------------*/ 175 176 // BEGIN isotope filtering 177 $container = jQuery('.portfolio-filterable'); 178 $container.imagesLoaded( function(){ 179 $container.isotope({ 180 itemSelector : '.portfolio-item', 181 layoutMode : 'fitRows' 182 }); 183 }); 184 185 // filter items when filter link is clicked 186 jQuery('#portfolio-filters li').click(function(){ 187 jQuery('#portfolio-filters li').removeClass('current'); 188 jQuery(this).addClass('current'); 189 var selector = jQuery(this).find('a').attr('data-filter'); 190 $container.isotope({ filter: selector }); 191 return false; 192 }); 193 194 // hover effect
195 jQuery('.image-overlay span').css({ opacity: 0 }); 196 jQuery('.image-overlay span').bind('mouseenter',function(){ 197 jQuery(this).stop(true).animate({ 'opacity': 1 }, 300).andSelf() 198 }).bind('mouseleave',function(){ 199 jQuery(this).stop(true).animate({ 'opacity': 0 }, 200).andSelf() 200 }); 201 202/* END CUSTOM JQUERY =================================================================== */ 203 204});
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.