1$(document).ready(function () { 2 function bcMediaQuery(x) { 3 if (x.matches && !isMobile) { 4 // console.log("bcMediaQuery MOBILE"); 5 // console.log(jQuery('#icon-menu-wrapper').outerWidth()); 6 // console.log(jQuery('#icon-menu-wrapper .single-listing-icon-row .et_pb_column').first().outerWidth()); 7 // console.log("padding",($('#icon-menu-wrapper .single-listing-icon-row').outerWidth() - $('#icon-menu-wrapper .single-listing-icon-row .et_pb_column').first().outerWidth())/2); 8 $("#icon-menu-wrapper .single-listing-icon-row .et_pb_column") 9 .first() 10 .attr("style", "padding-left: " + ($("#icon-menu-wrapper").outerWidth() - $("#icon-menu-wrapper .single-listing-icon-row .et_pb_column").first().outerWidth()) / 2 + "px !important"); 11 $("#icon-menu-wrapper .single-listing-icon-row .et_pb_column") 12 .last() 13 .attr("style", "padding-right: " + ($("#icon-menu-wrapper").outerWidth() - $("#icon-menu-wrapper .single-listing-icon-row .et_pb_column").last().outerWidth()) / 2 + "px !important"); 14 isMobile = true; 15 } else { 16 // console.log("bcMediaQuery DESKTOP"); 17 $("#icon-menu-wrapper .single-listing-icon-row .et_pb_column").first().attr("style", "padding-left: 0 !important"); 18 $("#icon-menu-wrapper .single-listing-icon-row .et_pb_column").last().attr("style", "padding-right: 0 !important"); 19 isMobile = false; 20 } 21 } 22 23 var isMobile = false, 24 checkSize = window.matchMedia("(max-width: 600px)"); 25 bcMediaQuery(checkSize); 26 checkSize.addListener(bcMediaQuery); 27 28 function centerScrollIcons(iconNum) { 29 var elementWidths = []; 30 var container = $("#icon-menu-wrapper .single-listing-icon-row"); 31 $("#icon-menu-wrapper .single-listing-icon-row .et_pb_column").each(function (i) { 32 elementWidths.push($(this).outerWidth()); 33 }); 34 var scrollPos = 0; 35 switch (iconNum) { 36 case 1: 37 scrollPos = elementWidths[0] - (container.width() - elementWidths[1]) / 2; 38 break; 39 case 2: 40 scrollPos = elementWidths[0] + elementWidths[1] - (container.width() - elementWidths[2]) / 2; 41 break; 42 case 3: 43 scrollPos = elementWidths[0] + elementWidths[1] + elementWidths[2] - (container.width() - elementWidths[3]) / 2; 44 break; 45 default: 46 scrollPos = ((container.width() - elementWidths[0]) / 2) * -1; 47 break; 48 } 49 container.animate( 50 { 51 scrollLeft: scrollPos, 52 }, 53 0 54 ); 55 } 56 var wrapperClasses = $.trim($("#icon-menu-wrapper").attr("class")), 57 wrapperClassesArray = wrapperClasses.split(/\s+/), 58 wrapperID = "#icon-menu-wrapper", 59 highlight, 60 classSubstr; 61 $.each(wrapperClassesArray, function (index, entry) { 62 classSubstr = entry.substring(entry.indexOf("_") + 1); 63 if (classSubstr != "") { 64 highlight = wrapperID + " .et_pb_module." + classSubstr; 65 $(highlight).each(function () { 66 $(this).addClass("highlight"); 67 }); 68 } 69 }); 70 classSubstr = wrapperClassesArray[0].substring(wrapperClassesArray[0].indexOf("_") + 1); 71 switch (classSubstr) { 72 case "cabins-cottages": 73 centerScrollIcons(1); 74 break; 75 case "hotels-inns": 76 centerScrollIcons(2); 77 break; 78 case "camping-rv": 79 centerScrollIcons(3); 80 break; 81 case "art-culture": 82 centerScrollIcons(1); 83 break; 84 case "entertainment": 85 centerScrollIcons(2); 86 break; 87 case "outdoor-adventure": 88 centerScrollIcons(3); 89 break; 90 case "coffee-tea": 91 centerScrollIcons(1); 92 break; 93 case "sweets-and-treats": 94 centerScrollIcons(2); 95 break; 96 case "breweries-wineries-distilleries": 97 centerScrollIcons(3); 98 break; 99 case "out-of-town": 100 centerScrollIcons(1); 101 break; 102 default: 103 centerScrollIcons(0); 104 break; 105 } 106});
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.