1/** 2 * @slideshow_height.js 3 * Adjust the heights of text boxes in slideshow 4 */ 5 6var resizeTimer; 7 8jQuery(document).ready(function(){ 9 setSlideHeights(); 10}); 11 12/** 13 reload when browser is resized 14 **/ 15jQuery(window).resize(function() { 16 // only let the resize fire once the resizing has stopped #16493 17 clearTimeout(resizeTimer); 18 resizeTimer = setTimeout(function() { 19 setSlideHeights(); 20 },250); 21}); 22 23function setSlideHeights() { 24 //console.log("setSlideHeights"); 25 // Make the text wrapper the same height as its adjacent image 26 jQuery(".swiper-container").each(function () { 27 //console.log("setting slide heights in " + jQuery(this).attr("id")); 28 29 // 14610 - find max height first 30 var maxTextHeight = 0; 31 jQuery(jQuery(this).find(".swiper-slide.items-per-slide-1")).each(function () { 32 var imageHeight = jQuery(this).find(".slide-wrapper .image-wrapper").height(); 33 var textHeight = jQuery(this).find(".slide-wrapper .text-wrapper").height(); 34 var maxHeight = Math.max(textHeight, imageHeight); 35 maxTextHeight = Math.max(textHeight, maxHeight); 36 }); 37 //console.log('Max Height = ' + maxTextHeight); 38 39 // 14610 - then apply if necessary 40 jQuery(jQuery(this).find(".swiper-slide.items-per-slide-1")).each(function () { 41 var responsiveBreakPointWidth = 768; // Slides less than this wide act responsively - ie. with text below. 42 var slideWidth = jQuery(this).find(".slide-wrapper").width(); 43 var imageHeight = jQuery(this).find(".slide-wrapper .image-wrapper").height(); 44 //var imageWidth = jQuery(this).find(".slide-wrapper .image-wrapper").width(); 45 var textHeight = jQuery(this).find(".slide-wrapper .text-wrapper").height(); 46 //var textWidth = jQuery(this).find(".slide-wrapper .text-wrapper").width(); 47 //console.log(jQuery(this).attr("class") + ": " + slideWidth + "px; image: " + imageWidth + " x " + imageHeight + " text: " + textWidth + " x " + textHeight); 48 if ((textHeight > imageHeight)) { 49 jQuery(this).find(".slide-wrapper").addClass("responsive"); 50 } else if ((slideWidth <= responsiveBreakPointWidth)) { 51 jQuery(this).find(".slide-wrapper").addClass("responsive"); 52 jQuery(this).find(".slide-wrapper.text-block .text-wrapper").height(maxTextHeight); 53 } else { 54 jQuery(this).find(".slide-wrapper").removeClass("responsive"); 55 // jQuery(this).find(".slide-wrapper.text-block .text-wrapper").height(maxHeight); 56 // jQuery(this).find(".slide-wrapper.text-block .image-wrapper").height(maxHeight); 57 } 58 }); 59 60 }); 61}
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.