1jQuery(document).ready(function($) { 2 3 $(document).mouseup(function (e) { 4 var container = $("#MM"); 5 6 if (!container.is(e.target) // if the target of the click isn't the container... 7 && container.has(e.target).length === 0) { // ... nor a descendant of the container 8 container.find('.sub-menu').hide(); 9 } 10 }); 11 12 $('.touching').on( 'click', '.hasSubMenu', function(e) { 13 e.preventDefault(); 14 var thisNext = $(this).next(); 15 $('.sub-menu').each(function() { 16 if($(this).css('display') == "block" && thisNext.css('display') != "block" ){ 17 $(this).hide('slow'); 18 } 19 }); 20 $(this).parent().addClass('li_hover'); 21 if(thisNext.css('display') == 'none') { 22 $(this).next().slideDown(); 23 } else { 24 $(this).next().slideUp(); 25 $(this).parent().removeClass('li_hover'); 26 } 27 }); 28 $('.touching .sub-menu a').on( 'click', function(e) { 29 var thisNext = $(this).next(); 30 if($(this).children().size() > 0) { 31 e.preventDefault(); 32 thisNext.toggle('600', 'linear'); 33 34 } 35 }); 36 37 $('#MM_responsive_show').on( 'click', function() { 38 $(this).hide(); 39 $('#MM_responsive_hide, #MM').show(); 40 }); 41 42 $('#MM_responsive_hide').on( 'click', function() { 43 $("#MM_responsive_hide, #MM").hide(); 44 $('#MM_responsive_show').show(); 45 }); 46 47 // Home slider 48 // The function with timeout for waiting for other functions' completion 49 setTimeout(function() { 50 $('.slideShow img').each(function() { 51 if($(this).height() != 0) { 52 var smallHeight = $(this).height(); 53 var originalHeight = $('.slideShow').height(); 54 if (smallHeight < originalHeight) { 55 $('.slideShow').height(smallHeight); 56 } 57 } 58 }); 59 $('.slideShow').responsiveScale(); 60 $('.slideShow .contentSlide').responsiveScale(); 61 $('.slideShow .slideAnimate img').responsiveScale(); 62 }, 300); 63 64 $(window).resize(function() { 65 66 // Portfolio 67 $('.portfolio-list').responsivePortfolioScale(); // Initialize responsive scaling 68 $('.portfolio-list').find('.item-container').css('height','auto'); //reset on resize 69 $('.portfolio-list').portfolioHeightFix(); // reapply after resize 70 71 // Menu 72 if ( window.innerWidth < 768 ) { 73 $('#MM').hide(); 74 $('#MM_responsive_hide').hide(); 75 $('#MM_responsive_show').show(); 76 } else { 77 $('#MM').show(); 78 $('#MM_responsive_hide').hide(); 79 $('#MM_responsive_show').hide(); 80 } 81 82 // Home slider 83 $('.slideShow img').each(function() { 84 if($(this).height() != 0) { 85 var smallHeight = $(this).height(); 86 var originalHeight = $('.slideShow').height(); 87 if (smallHeight < originalHeight) { 88 $('.slideShow').height(smallHeight); 89 $('.slideShow > div[id^="SS-"] div').height(smallHeight); 90 } 91 } 92 }); 93 94 // Contact Form 95 $('.contactFormWrapper input, .contactFormWrapper textarea, .publicForm input, .publicForm textarea').each( function() { 96 var maxW = $('.contactFormWrapper').width(); 97 $(this).css('max-width', maxW); 98 }); 99 }); 100 101 102}); 103 104 105 106jQuery(window).load(function ($) { 107 jQuery('.portfolio-list').responsivePortfolioScale(); // Initialize responsive scaling 108 jQuery('.portfolio-list').find('.item-container').css('height','auto'); //reset on resize 109 jQuery('.portfolio-list').portfolioHeightFix(); // reapply after resize 110}); 111 112// ====================================================================== 113// Responsive Design Functions 114// ====================================================================== 115 116// Browser re-size adjustments (important for orientation change) 117// ------------------------------------------------------------------- 118(function($) { 119 // Portfolio Height Adjust (for uniform display if heigh variation) 120 // ------------------------------------------------------------------- 121 $.fn.portfolioHeightFix = function(opts) { 122 var pGroup = $(this); 123 // for each portfolio instance 124 this.each( function() { 125 var h = 0; 126 // get all items in the group 127 $pItems = $(this).find('.item-container'); 128 129 $pItems.each( function(i, val) { 130 console.log($(this).attr('class')); 131 if ($(this).height() > h) { 132 // get the greatest height value 133 h = $(this).height(); 134 } 135 }); 136 137 138 $pItems.css('height',h+'px'); // set all to max height 139 }); 140 } 141
142 $.fn.responsiveScale = function(ratio) { 143 this.each(function() { 144 var _this = $(this), 145 _w = ( typeof _this.data('width') !== "undefined" ) ? _this.data('width') : _this.width(), 146 _h = ( typeof _this.data('height') !== "undefined" ) ? _this.data('height') : _this.height(); 147 148 if (typeof ratio !== "undefined") { 149 var _ratio = ratio; 150 } else { 151 var _ratio = (typeof _this.data('ratio') !== "undefined") ? _this.data('ratio') : _w / _h; 152 } 153 $(window).resize(function() { 154 var w = _this.width(); 155 _this.css('height', Math.round((w / _ratio))+'px'); 156 }); 157 }); 158 159 $(window).trigger('resize'); 160 return this; 161 }; 162 163 $.fn.responsivePortfolioScale = function() { 164 this.each(function() { 165 166 $pageW = $('#Middle').width(); 167 var _this = $(this), 168 cols = _this.data('values').cols, 169 col_w = _this.data('values').col_w, 170 margin = _this.data('values').margin, 171 width = _this.data('values').width, 172 area = _this.data('values').area, 173 ratio = _this.data('values').ratio, 174 containerW = _this.width(); 175 176 // image and column sizes 177 working_area = containerW - (margin * (cols - 1)) - 1; 178 colW = Math.floor(working_area / cols); 179 imgOldW = parseInt(_this.find('img').attr('width')); 180 itemContainer = $('.textwidget .portfolio-list').find('.item-container'); 181 if ( $pageW > 480 && colW <= imgOldW ) { 182 imgW = colW + 'px'; 183 } else if( $pageW > 480 && colW > imgOldW ) { 184 itemContainer.css('width', imgOldW); 185 imgW = colW + 'px'; 186 } else { 187 imgW = ''; 188 } 189 _this.find('li').each( function() { 190 $(this).css('width',colW+'px'); 191 }); 192 _this.find('.portfolio-image').each( function() { 193 $(this).css({'width':imgW, 'height':'auto'}); 194 }); 195 }); 196 197 return this; 198 }; 199 $('.slideShow').responsiveScale(); 200 $('.slideShow .contentSlide').responsiveScale(); 201 $('.slideShow .slideAnimate img').responsiveScale(); 202 203})(jQuery);
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.