mobileAndTabletcheck = function() { var check = false; (function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))) check = true;})(navigator.userAgent||navigator.vendor||window.opera); return check; }; var ahost = window.location.hostname; var iphone = false; if (navigator.userAgent.toLowerCase().indexOf("iphone") != -1 || navigator.userAgent.toLowerCase().indexOf("ipad") != -1) { iphone = true; } /* * baseNum = Pixel value for Full Width * percentIncDec = Percentage amount in decimal * e.g. 5% => 0.05 * 10% => 0.1 * 50% => 0.5 * 100% => 1 * 150% => 1.5 * 200% => 2 * * percent_format = return should be in px or %age => true = %age / false => px * * */ PixelCalc = function(baseNum, percentIncDec, percent_format) { var is_percentage = percent_format === undefined ? false : percent_format; //Generally, 1em = 12pt = 16px = 100% var perPercent = 6.25; //1px = 6.25% var changedNum = Math.round(baseNum * percentIncDec); if(baseNum === 0){ if(is_percentage) return "0%"; else return "0px"; } if(is_percentage){ return ((changedNum * perPercent).toFixed(2) + "%"); } else{ return (changedNum + "px"); } }; jQuery(document).ready(function () { jQuery(".leadpops-left").show(); var isIE = false || !!document.documentMode; var isEdge = !isIE && !!window.StyleMedia; // var desktopResponsive = jQuery("style.two_lines").html(); if (parent.window.bar.requestIsValid == "false" || parent.window.bar.stickyBarStatus == 0) { jQuery('#' + parent.window.bar.placeholderdivid, window.parent.document).remove(); jQuery('#' + parent.window.bar.pushdivid, window.parent.document).remove(); } if (parent.window.bar.requestIsValid == "true" && parent.window.bar.stickyBarInstalled == 0) { jQuery.ajax({ type: "POST", url: window.rebeliqPathBaseUrl + "/updatepending.php", data: { hash: parent.window.bar.link_hash, hash_id: parent.window.bar.link_cid }, success: (function( msg ) { }) }); } function updateStylesForSetVersion(){ if(lpStickySettings.version == '1'){ var $link = jQuery('#linkanimation'); var $linkParent = $link.parent(); var $ctaText = jQuery('#lpcta'); var $stickyWrap = jQuery(".leadpops-left"); var ctaFontSize; var windowWidth = $(window).width(); var height = 100; if(lpStickyAdminConfig.stickySize == 'm'){ height = 75; } else if(lpStickyAdminConfig.stickySize == 's'){ height = 50; } if(windowWidth < 1280){ if(!parseInt($linkParent.css('margin-left'))){ marginLeft = '0px' } $link.css({ 'margin-left': 0, }) ctaFontSize = parseFloat($ctaText.css('font-size')) $stickyWrap.css("flex-direction","column"); $ctaText.css({ 'width': '90%', 'line-height': 1.2 }) var $ctaLink = $('#lpctalink'); $ctaLink.css('margin', '3px 0'); var ctaLinkHeight = $ctaLink.outerHeight(); $ctaText.css('height', height - ctaLinkHeight + 6); // margin if(windowWidth < 768){ $link.css('font-size', '15px'); } } else { var padding = '19px 20px'; var marginLeft = '65px'; var btnFontSize = 26; ctaFontSize = 30; if(lpStickyAdminConfig.stickySize == 'm'){ padding = '12px 15px'; marginLeft = '40px'; ctaFontSize = 23; btnFontSize = 20; } else if(lpStickyAdminConfig.stickySize == 's'){ padding = '8px 10px'; marginLeft = '20px'; ctaFontSize = 12; btnFontSize = 12; } // This is experimental, it may not work in all cases, it // can be removed if(navigator.userAgent.toLowerCase().indexOf('firefox') > -1){ // Chrome and firefox have inconsistent font rendering // So to make the make it consistent to some extent // We would adjust font size specifically for firefox var firefoxFontInconsistency = 0.98805551528931 ctaFontSize = ctaFontSize * firefoxFontInconsistency; btnFontSize = btnFontSize * firefoxFontInconsistency; } $link.css({ 'padding': padding, 'margin-left': marginLeft, 'font-size': btnFontSize + 'px', 'margin-right': '-1px', 'white-space': 'nowrap' }) $ctaText.css({ 'font-size': ctaFontSize + 'px', 'line-height': '1.2', 'height': height }) $stickyWrap.css('padding', '20px 50px'); $stickyWrap.css("flex-direction","row"); } var ctaScrollHeight = $ctaText[0].scrollHeight; var ctaInnerHeight = $ctaText.innerHeight() if(ctaScrollHeight > ctaInnerHeight){ var numberOflines = Math.ceil(ctaScrollHeight / ctaFontSize) var newFontSize = ctaInnerHeight / numberOflines; newFontSize = Math.max(newFontSize, 12); $ctaText.css('font-size', newFontSize + 'px') } } } var slimRatio = parent.window.bar.stickySlimRatio; var mobileCtaHeight = jQuery('#lpcta').prop("scrollHeight"); var mobileCtaLinkHeight = jQuery('#lpctalink').prop("scrollHeight"); var mobileHeight = mobileCtaHeight + mobileCtaLinkHeight + "px"; var originalCtaHeight = jQuery('#lpcta').height(); // backup height jQuery('#lpcta').height(0); var actualTextCtaHeight = jQuery('#lpcta').get(0).scrollHeight - jQuery('#lpcta').css('paddingTop').replace('px','')*1 - jQuery('#lpcta').css('paddingBottom').replace('px','')*1; // actual text height jQuery('#lpcta').height(originalCtaHeight); // set back original height (or new height using h) var ctaLineHeight = jQuery("#lpcta").css('line-height'); ctaLineHeight = parseFloat(ctaLineHeight); var rowsCta = actualTextCtaHeight / ctaLineHeight; rowsCta = Math.round(rowsCta); var originalCtaLinkHeight = $('#lpctalink').height(); // backup height jQuery('#lpctalink').height(0); var actualTextCtaLinkHeight = jQuery('#lpctalink').get(0).scrollHeight - jQuery('#lpctalink').css('paddingTop').replace('px','')*1 - jQuery('#lpctalink').css('paddingBottom').replace('px','')*1; // actual text height jQuery('#lpctalink').height(originalCtaLinkHeight); // set back original height (or new height using h) var ctaLinkLineHeight = jQuery("#lpctalink").css('line-height'); ctaLinkLineHeight = parseFloat(ctaLinkLineHeight); var rowsCtaLink = actualTextCtaLinkHeight / ctaLinkLineHeight; rowsCtaLink = Math.round(rowsCtaLink); var orientation = screen.msOrientation || (screen.orientation || screen.mozOrientation || {}).type; if ((orientation === "portrait-secondary" || orientation === "portrait-primary") && (rowsCta < 2 && rowsCtaLink < 2 )) { mobileHeight = (mobileCtaHeight * 2) + mobileCtaLinkHeight + "px"; } var mobile = mobileAndTabletcheck(); var chgDiv = window.parent.document.getElementById(parent.window.bar.pushdivid); var changeToPortraitHeight = false; var changeToLandscapeHeight = false; var bumpPortraitHeight = false; var addHeight = false; if(jQuery('#lpcta').hasClass("mobcta")) { jQuery('#lpcta').removeClass("mobcta"); jQuery('.sticky-hide').removeClass("mobcta"); } console.log("is-mobile ? "+ mobile); if (mobile == true) { jQuery('#lpcta').addClass("mobcta"); jQuery('.sticky-hide').addClass("mobcta"); var ctaChars = jQuery(".cta").text().length; var ctaLinkChars = jQuery("#linkanimation").text().length; if (window.orientation == 0 || window.orientation == 180 || orientation === "portrait-secondary" || orientation === "portrait-primary") { if ((ctaChars + ctaLinkChars) > 59 && window.screen.width < 485) { var cHeight = jQuery('#' + parent.window.bar.pushdivid, window.parent.document).css("height"); cHeight = cHeight.replace("px",""); addHeight = true; var newHeight = cHeight * 1.1; } jQuery(".leadpops-left").css("flex-direction","column"); jQuery("p.cta").css("margin",PixelCalc(2, slimRatio)+" "+PixelCalc(0, slimRatio)); jQuery("p.ctalink").css("margin-top",PixelCalc(2, slimRatio)); jQuery("p.ctalink").css("margin-left",PixelCalc(0, slimRatio)); jQuery("p.ctalink").css("margin-right",PixelCalc(0, slimRatio)); jQuery("p.ctalink").css("margin-bottom",PixelCalc(8, slimRatio)); jQuery(".ctalink").css("display","flex"); jQuery(".ctalink").css("justify-content","center"); jQuery(".ctalink").css("align-items","center"); jQuery(".cta").css("display","flex"); jQuery(".cta").css("justify-content","center"); jQuery(".cta").css("align-items","center"); jQuery("p.cta").css("padding",PixelCalc(0, slimRatio)+" !important"); jQuery("p.cta").css("font-size",PixelCalc(20, slimRatio)); jQuery("p.cta").css("line-height",PixelCalc(20, slimRatio)); jQuery("p.ctalink").css("font-size",PixelCalc(22, slimRatio)); jQuery("p.ctalink").css("line-height",PixelCalc(22, slimRatio)); jQuery("#linkanimation").css("padding",PixelCalc(8, slimRatio)+" "+PixelCalc(15, slimRatio)); if(addHeight === true) { jQuery('#' + parent.window.bar.pushdivid, window.parent.document).css("height",newHeight); jQuery('#' + parent.window.bar.placeholderdivid, window.parent.document).css("height",newHeight); jQuery('.leadpops-wrap').css("height",newHeight); } if (rowsCta > 1 || rowsCtaLink > 1) { changeToLandscapeHeight = true; } } else if (window.orientation == -90 || window.orientation == 90 || orientation === "landscape-primary" || orientation === "landscape-secondary") { if ((ctaChars + ctaLinkChars) > 59 ) { var cHeight = jQuery('#' + parent.window.bar.pushdivid, window.parent.document).css("height"); cHeight = cHeight.replace("px",""); addHeight = true; var newHeight = cHeight * 1.1; } jQuery(".leadpops-left").css("flex-direction","column"); jQuery("p.cta").css("margin",PixelCalc(2, slimRatio)+" "+PixelCalc(0, slimRatio)); jQuery("p.ctalink").css("margin",PixelCalc(2, slimRatio)+" "+PixelCalc(0, slimRatio)); jQuery("p.cta").css("font-size",PixelCalc(24, slimRatio)); jQuery("p.cta").css("line-height",PixelCalc(24, slimRatio)); jQuery("p.ctalink").css("font-size",PixelCalc(20, slimRatio)); jQuery("p.ctalink").css("line-height",PixelCalc(20, slimRatio)); jQuery(".ctalink").css("display","flex"); jQuery(".ctalink").css("justify-content","center"); jQuery(".ctalink").css("align-items","center"); jQuery(".cta").css("display","flex"); jQuery(".cta").css("justify-content","center"); jQuery(".cta").css("align-items","center"); jQuery("#linkanimation").css("padding",PixelCalc(8, slimRatio)+" "+PixelCalc(15, slimRatio)); if(addHeight === true) { jQuery('#' + parent.window.bar.pushdivid, window.parent.document).css("height",newHeight); jQuery('#' + parent.window.bar.placeholderdivid, window.parent.document).css("height",newHeight); jQuery('.leadpops-wrap').css("height",newHeight); } bumpPortraitHeight = true; } if (iphone == true) { var iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream; var iw = (iOS) ? screen.width : window.innerWidth; var ih = (iOS) ? screen.height : window.innerHeight; if(window.orientation == 0 || window.orientation == 180){ var ios_width = iw < ih ? iw : ih; } else { var ios_width = iw > ih ? iw : ih; } chgDiv.style.width = ios_width + 'px'; } else { //chgDiv.style.width = window.parent.screen.width + 'px'; chgDiv.style.width = '100%'; //alert("window.parent.screen.width="+window.parent.screen.width + " \n screen.width="+ screen.width + " \n window.innerWidth=" +window.innerWidth); } } else { // Desktop Case window.parent.document.body.style.width = '100%'; window.parent.document.body.style.height = '100%'; window.parent.document.body.style.padding = '0px'; window.parent.document.body.style.margin = '0px'; var ctaChars = jQuery(".cta").text().length; var ctaLinkChars = jQuery("#linkanimation").text().length; var currentWidth = jQuery(window).width(); if ((ctaChars + ctaLinkChars) > 90) { // needs to be responsive if > 1 row jQuery(".leadpops-left").css("flex-direction","column"); if (isIE || isEdge) { jQuery(".leadpops-left").css("align-items","stretch"); } jQuery(".ctalink").css("display","flex"); jQuery(".ctalink").css("justify-content","center"); jQuery(".cta").css("display","flex"); jQuery(".cta").css("justify-content","center"); jQuery(".ctalink").css("align-items","center"); jQuery(".cta").css("align-items","center"); jQuery("p.cta").css("width",""); if (currentWidth <= 640) { jQuery("p.ctalink").css("font-size",PixelCalc(14, slimRatio)); jQuery("p.ctalink").css("line-height",PixelCalc(14, slimRatio)); jQuery("p.cta").css("font-size",PixelCalc(16, slimRatio)); jQuery("p.cta").css("line-height",PixelCalc(16, slimRatio)); jQuery("p.cta").css("width","85%"); jQuery("p.cta").css("margin",PixelCalc(4, slimRatio)+" "+PixelCalc(0, slimRatio)+" "+PixelCalc(0, slimRatio)+" "+PixelCalc(0, slimRatio)); jQuery("p.ctalink").css("margin",PixelCalc(12, slimRatio)+" "+PixelCalc(0, slimRatio)+" "+PixelCalc(12, slimRatio)+" "+PixelCalc(0, slimRatio)); jQuery("#linkanimation").css("padding",PixelCalc(8, slimRatio)+" "+PixelCalc(20, slimRatio)); } else if (currentWidth > 640 && currentWidth <= 767) { // mobile size jQuery("p.ctalink").css("font-size",PixelCalc(16, slimRatio)); jQuery("p.ctalink").css("line-height",PixelCalc(16, slimRatio)); jQuery("p.cta").css("font-size",PixelCalc(18, slimRatio)); jQuery("p.cta").css("line-height",PixelCalc(18, slimRatio)); jQuery("p.cta").css("margin",PixelCalc(4, slimRatio)+" "+PixelCalc(0, slimRatio)+" "+PixelCalc(0, slimRatio)+" "+PixelCalc(0, slimRatio)); jQuery("p.ctalink").css("margin",PixelCalc(12, slimRatio)+" "+PixelCalc(0, slimRatio)+" "+PixelCalc(12, slimRatio)+" "+PixelCalc(0, slimRatio)); jQuery("#linkanimation").css("padding",PixelCalc(8, slimRatio)+" "+PixelCalc(20, slimRatio)); } else if (currentWidth > 767 && currentWidth <= 979) { // mobile size jQuery("p.ctalink").css("font-size",PixelCalc(20, slimRatio)); jQuery("p.ctalink").css("line-height",PixelCalc(20, slimRatio)); jQuery("p.cta").css("font-size",PixelCalc(22, slimRatio)); jQuery("p.cta").css("line-height",PixelCalc(22, slimRatio)); jQuery("p.cta").css("margin",PixelCalc(4, slimRatio)+" "+PixelCalc(0, slimRatio)+" "+PixelCalc(0, slimRatio)+" "+PixelCalc(0, slimRatio)); jQuery("p.ctalink").css("margin",PixelCalc(12, slimRatio)+" "+PixelCalc(0, slimRatio)+" "+PixelCalc(12, slimRatio)+" "+PixelCalc(0, slimRatio)); jQuery("#linkanimation").css("padding",PixelCalc(8, slimRatio)+" "+PixelCalc(20, slimRatio)); } else if (currentWidth > 979) { jQuery("p.ctalink").css("font-size",PixelCalc(24, slimRatio)); jQuery("p.ctalink").css("line-height",PixelCalc(24, slimRatio)); jQuery("p.cta").css("font-size",PixelCalc(24, slimRatio)); jQuery("p.cta").css("line-height",PixelCalc(24, slimRatio)); jQuery("p.cta").css("margin",PixelCalc(4, slimRatio)+" "+PixelCalc(0, slimRatio)+" "+PixelCalc(0, slimRatio)+" "+PixelCalc(0, slimRatio)); jQuery("p.ctalink").css("margin",PixelCalc(12, slimRatio)+" "+PixelCalc(0, slimRatio)+" "+PixelCalc(12, slimRatio)+" "+PixelCalc(0, slimRatio)); jQuery("#linkanimation").css("padding",PixelCalc(8, slimRatio)+" "+PixelCalc(20, slimRatio)); jQuery("#linkanimation").css("padding",PixelCalc(8, slimRatio)+" "+PixelCalc(20, slimRatio)); } jQuery(window).resize(function() { jQuery("p.cta").css("width",""); var newWidth = jQuery(window).width(); if (newWidth <= 640) { jQuery("p.ctalink").css("font-size",PixelCalc(14, slimRatio)); jQuery("p.ctalink").css("line-height",PixelCalc(14, slimRatio)); jQuery("p.cta").css("font-size",PixelCalc(16, slimRatio)); jQuery("p.cta").css("line-height",PixelCalc(16, slimRatio)); jQuery("p.cta").css("width","85%"); jQuery("p.cta").css("margin",PixelCalc(4, slimRatio)+" "+PixelCalc(0, slimRatio)+" "+PixelCalc(0, slimRatio)+" "+PixelCalc(0, slimRatio)); jQuery("p.ctalink").css("margin",PixelCalc(12, slimRatio)+" "+PixelCalc(0, slimRatio)+" "+PixelCalc(12, slimRatio)+" "+PixelCalc(0, slimRatio)); jQuery("#linkanimation").css("padding",PixelCalc(8, slimRatio)+" "+PixelCalc(20, slimRatio)); } else if (newWidth > 640 && newWidth <= 767) { // mobile size jQuery("p.ctalink").css("font-size",PixelCalc(16, slimRatio)); jQuery("p.ctalink").css("line-height",PixelCalc(16, slimRatio)); jQuery("p.cta").css("font-size",PixelCalc(18, slimRatio)); jQuery("p.cta").css("line-height",PixelCalc(18, slimRatio)); jQuery("p.cta").css("margin",PixelCalc(4, slimRatio)+" "+PixelCalc(0, slimRatio)+" "+PixelCalc(0, slimRatio)+" "+PixelCalc(0, slimRatio)); jQuery("p.ctalink").css("margin",PixelCalc(12, slimRatio)+" "+PixelCalc(0, slimRatio)+" "+PixelCalc(12, slimRatio)+" "+PixelCalc(0, slimRatio)); jQuery("#linkanimation").css("padding",PixelCalc(8, slimRatio)+" "+PixelCalc(20, slimRatio)); } else if (newWidth > 767 && newWidth <= 979) { jQuery("p.ctalink").css("font-size",PixelCalc(20, slimRatio)); jQuery("p.ctalink").css("line-height",PixelCalc(20, slimRatio)); jQuery("p.cta").css("font-size",PixelCalc(22, slimRatio)); jQuery("p.cta").css("line-height",PixelCalc(22, slimRatio)); jQuery("p.cta").css("margin",PixelCalc(4, slimRatio)+" "+PixelCalc(0, slimRatio)+" "+PixelCalc(0, slimRatio)+" "+PixelCalc(0, slimRatio)); jQuery("p.ctalink").css("margin",PixelCalc(12, slimRatio)+" "+PixelCalc(0, slimRatio)+" "+PixelCalc(12, slimRatio)+" "+PixelCalc(0, slimRatio)); jQuery("#linkanimation").css("padding",PixelCalc(8, slimRatio)+" "+PixelCalc(20, slimRatio)); } else if (newWidth > 979) { jQuery("p.ctalink").css("font-size",PixelCalc(24, slimRatio)); jQuery("p.ctalink").css("line-height",PixelCalc(24, slimRatio)); jQuery("p.cta").css("font-size",PixelCalc(24, slimRatio)); jQuery("p.cta").css("line-height",PixelCalc(24, slimRatio)); jQuery("p.cta").css("margin",PixelCalc(4, slimRatio)+" "+PixelCalc(0, slimRatio)+" "+PixelCalc(0, slimRatio)+" "+PixelCalc(0, slimRatio)); jQuery("p.ctalink").css("margin",PixelCalc(12, slimRatio)+" "+PixelCalc(0, slimRatio)+" "+PixelCalc(12, slimRatio)+" "+PixelCalc(0, slimRatio)); jQuery("#linkanimation").css("padding",PixelCalc(8, slimRatio)+" "+PixelCalc(20, slimRatio)); } updateStylesForSetVersion(); }); } else { jQuery("p.cta").css("width",""); if (currentWidth <= 640) { jQuery(".leadpops-left").css("flex-direction","column"); jQuery(".ctalink").css("display","flex"); jQuery(".ctalink").css("justify-content","center"); jQuery(".ctalink").css("align-items","center"); jQuery(".cta").css("display","flex"); jQuery(".cta").css("justify-content","center"); jQuery(".cta").css("align-items","center"); jQuery("p.ctalink").css("font-size",PixelCalc(18, slimRatio)); jQuery("p.ctalink").css("line-height",PixelCalc(18, slimRatio)); jQuery("p.cta").css("font-size",PixelCalc(22, slimRatio)); jQuery("p.cta").css("line-height",PixelCalc(22, slimRatio)); jQuery("p.cta").css("width","85%"); jQuery("p.cta").css("margin",PixelCalc(2, slimRatio)+" "+PixelCalc(0, slimRatio)); jQuery("p.ctalink").css("margin",PixelCalc(2, slimRatio)+" "+PixelCalc(0, slimRatio)); jQuery("#linkanimation").css("padding",PixelCalc(8, slimRatio)+" "+PixelCalc(20, slimRatio)); } else if (currentWidth > 640 && currentWidth <= 767) { jQuery(".leadpops-left").css("flex-direction","column"); jQuery(".ctalink").css("display","flex"); jQuery(".ctalink").css("justify-content","center"); jQuery(".ctalink").css("align-items","center"); jQuery(".cta").css("display","flex"); jQuery(".cta").css("justify-content","center"); jQuery(".cta").css("align-items","center"); jQuery("p.ctalink").css("font-size",PixelCalc(22, slimRatio)); jQuery("p.ctalink").css("line-height",PixelCalc(22, slimRatio)); jQuery("p.cta").css("font-size",PixelCalc(26, slimRatio)); jQuery("p.cta").css("line-height",PixelCalc(26, slimRatio)); jQuery("p.cta").css("margin",PixelCalc(2, slimRatio)+" "+PixelCalc(0, slimRatio)); jQuery("p.ctalink").css("margin",PixelCalc(2, slimRatio)+" "+PixelCalc(0, slimRatio)); jQuery("#linkanimation").css("padding",PixelCalc(8, slimRatio)+" "+PixelCalc(20, slimRatio)); } else if (currentWidth > 767 && currentWidth <= 979) { jQuery(".leadpops-left").css("flex-direction","column"); jQuery(".ctalink").css("display","flex"); jQuery(".ctalink").css("justify-content","center"); jQuery(".ctalink").css("align-items","center"); jQuery(".cta").css("display","flex"); jQuery(".cta").css("justify-content","center"); jQuery(".cta").css("align-items","center"); jQuery("p.ctalink").css("font-size",PixelCalc(24, slimRatio)); jQuery("p.ctalink").css("line-height",PixelCalc(24, slimRatio)); jQuery("p.cta").css("font-size",PixelCalc(28, slimRatio)); jQuery("p.cta").css("line-height",PixelCalc(28, slimRatio)); jQuery("p.cta").css("margin",PixelCalc(2, slimRatio)+" "+PixelCalc(0, slimRatio)); jQuery("p.ctalink").css("margin",PixelCalc(2, slimRatio)+" "+PixelCalc(0, slimRatio)); jQuery("#linkanimation").css("padding",PixelCalc(8, slimRatio)+" "+PixelCalc(20, slimRatio)); } else if (currentWidth > 979) { jQuery(".leadpops-left").css("flex-direction","row"); jQuery("p.ctalink").css("margin-left", PixelCalc(3, slimRatio)); jQuery(".cta").css("margin-right", PixelCalc(3, slimRatio)); jQuery("p.ctalink").css("font-size",PixelCalc(26, slimRatio)); jQuery("p.ctalink").css("line-height", PixelCalc(26, slimRatio)); jQuery("p.cta").css("font-size", PixelCalc(30, slimRatio)); jQuery("p.cta").css("line-height", PixelCalc(30, slimRatio)); jQuery("#linkanimation").css("padding",PixelCalc(8, slimRatio)+" "+PixelCalc(20, slimRatio)); } jQuery(window).resize(function() { jQuery("p.cta").css("width",""); var newWidth = jQuery(window).width(); if (newWidth <= 640) { jQuery(".leadpops-left").css("flex-direction","column"); jQuery(".ctalink").css("display","flex"); jQuery(".ctalink").css("justify-content","center"); jQuery(".ctalink").css("align-items","center"); jQuery(".cta").css("display","flex"); jQuery(".cta").css("justify-content","center"); jQuery(".cta").css("align-items","center"); jQuery("p.ctalink").css("font-size",PixelCalc(18, slimRatio)); jQuery("p.ctalink").css("line-height",PixelCalc(18, slimRatio)); jQuery("p.cta").css("font-size",PixelCalc(22, slimRatio)); jQuery("p.cta").css("line-height",PixelCalc(22, slimRatio)); jQuery("p.cta").css("width","85%"); jQuery("p.cta").css("margin",PixelCalc(2, slimRatio)+" "+PixelCalc(0, slimRatio)); jQuery("p.ctalink").css("margin",PixelCalc(2, slimRatio)+" "+PixelCalc(0, slimRatio)); jQuery("#linkanimation").css("padding",PixelCalc(8, slimRatio)+" "+PixelCalc(20, slimRatio)); } else if (newWidth > 640 && newWidth <= 767 ) { jQuery(".leadpops-left").css("flex-direction","column"); jQuery(".ctalink").css("display","flex"); jQuery(".ctalink").css("justify-content","center"); jQuery(".ctalink").css("align-items","center"); jQuery(".cta").css("display","flex"); jQuery(".cta").css("justify-content","center"); jQuery(".cta").css("align-items","center"); jQuery("p.ctalink").css("font-size",PixelCalc(22, slimRatio)); jQuery("p.ctalink").css("line-height",PixelCalc(22, slimRatio)); jQuery("p.cta").css("font-size",PixelCalc(26, slimRatio)); jQuery("p.cta").css("line-height",PixelCalc(26, slimRatio)); jQuery("p.cta").css("margin",PixelCalc(2, slimRatio)+" "+PixelCalc(0, slimRatio)); jQuery("p.ctalink").css("margin",PixelCalc(2, slimRatio)+" "+PixelCalc(0, slimRatio)); } else if (newWidth > 767 && newWidth <= 979) { jQuery(".leadpops-left").css("flex-direction","column"); jQuery(".ctalink").css("display","flex"); jQuery(".ctalink").css("justify-content","center"); jQuery(".ctalink").css("align-items","center"); jQuery(".cta").css("display","flex"); jQuery(".cta").css("justify-content","center"); jQuery(".cta").css("align-items","center"); jQuery("p.ctalink").css("font-size",PixelCalc(24, slimRatio)); jQuery("p.ctalink").css("line-height",PixelCalc(24, slimRatio)); jQuery("p.cta").css("font-size",PixelCalc(28, slimRatio)); jQuery("p.cta").css("line-height",PixelCalc(28, slimRatio)); jQuery("p.cta").css("margin",PixelCalc(2, slimRatio)+" "+PixelCalc(0, slimRatio)); jQuery("p.ctalink").css("margin",PixelCalc(2, slimRatio)+" "+PixelCalc(0, slimRatio)); } else if (newWidth > 979) { jQuery(".leadpops-left").css("flex-direction","row"); jQuery("p.ctalink").css("margin-left",PixelCalc(3, slimRatio)); jQuery(".cta").css("margin-right",PixelCalc(3, slimRatio)); jQuery("p.ctalink").css("font-size",PixelCalc(26, slimRatio)); jQuery("p.ctalink").css("line-height",PixelCalc(26, slimRatio)); jQuery("p.cta").css("font-size",PixelCalc(30, slimRatio)); jQuery("p.cta").css("line-height",PixelCalc(30, slimRatio)); } updateStylesForSetVersion() }); } } updateStylesForSetVersion(); window.onorientationchange = function() { console.log(window.screen.width + " " + chgDiv.style.width + " " + window.orientation); if (changeToPortraitHeight === true) { if (window.orientation == 0 || window.orientation == 180 ) { jQuery(".leadpops-left").css("flex-direction","column"); jQuery("p.cta").css("margin",PixelCalc(2, slimRatio)+" "+PixelCalc(0, slimRatio)); jQuery("p.ctalink").css("margin",PixelCalc(2, slimRatio)+" "+PixelCalc(0, slimRatio)); jQuery("p.cta").css("font-size",PixelCalc(24, slimRatio)); jQuery("p.cta").css("line-height",PixelCalc(24, slimRatio)); jQuery(".ctalink").css("display","flex"); jQuery(".ctalink").css("justify-content","center"); jQuery(".ctalink").css("align-items","center"); mobileHeight = (mobileCtaHeight * 2) + mobileCtaLinkHeight + "px"; jQuery('#' + parent.window.bar.pushdivid, window.parent.document).css("height",mobileHeight); jQuery('#' + parent.window.bar.placeholderdivid, window.parent.document).css("height",mobileHeight); jQuery('.leadpops-wrap').css("height",mobileHeight); } else { jQuery(".leadpops-left").css("flex-direction","column"); jQuery(".leadpops-left").css("align-items","center"); jQuery("p.cta").css("margin-right",PixelCalc(3, slimRatio)); jQuery("p.cta").css("font-size",PixelCalc(30, slimRatio)); jQuery("p.cta").css("line-height",PixelCalc(30, slimRatio)); jQuery("p.cta").css("padding",PixelCalc(2, slimRatio)); jQuery("p.ctalink").css("margin-left",PixelCalc(3, slimRatio)); jQuery(".cta").css("margin-right",PixelCalc(3, slimRatio)); jQuery(".ctalink").css("display","flex"); jQuery(".ctalink").css("flex-direction","row"); jQuery(".ctalink").css("justify-content","center"); jQuery(".ctalink").css("align-items","center"); jQuery("p.ctalink").css("font-size",PixelCalc(24, slimRatio)); jQuery("p.ctalink").css("line-height",PixelCalc(24, slimRatio)); jQuery("p.ctalink").css("padding",PixelCalc(0, slimRatio)); mobileHeight = (mobileCtaHeight * 2) + mobileCtaLinkHeight + "px"; jQuery('#' + parent.window.bar.pushdivid, window.parent.document).css("height",mobileHeight); jQuery('#' + parent.window.bar.placeholderdivid, window.parent.document).css("height",mobileHeight); jQuery('.leadpops-wrap').css("height",mobileHeight); console.log("#419") } } else if (changeToLandscapeHeight === true) { if (window.orientation == 0 || window.orientation == 180 ) { jQuery("p.cta").css("font-size",PixelCalc(20, slimRatio)); jQuery("p.cta").css("line-height",PixelCalc(20, slimRatio)); } else { jQuery("p.cta").css("font-size",PixelCalc(24, slimRatio)); jQuery("p.cta").css("line-height",PixelCalc(24, slimRatio)); } } else if (bumpPortraitHeight === true) { if (window.orientation == 0 || window.orientation == 180 ) { jQuery("p.cta").css("font-size",PixelCalc(20, slimRatio)); jQuery("p.cta").css("line-height",PixelCalc(20, slimRatio)); } else { // back to landscape jQuery("p.cta").css("font-size",PixelCalc(24, slimRatio)); jQuery("p.cta").css("line-height",PixelCalc(24, slimRatio)); } } // works on android if (iphone == true) { // works on ios //chgDiv.style.width = window.parent.innerWidth + 'px'; var iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream; var iw = (iOS) ? screen.width : window.innerWidth; var ih = (iOS) ? screen.height : window.innerHeight; // console.log(ahost +" (iOS: "+iOS+") "+ " >> " + window.screen.width + " >> " + iw + " >> " + window.parent.innerWidth +" >> "+ window.orientation + " >>> W:"+iw+" x H:"+ih); // if(ahost == 'l-demo-5358.leadpops.com'){ if(window.orientation == 0 || window.orientation == 180){ var ios_width = iw < ih ? iw : ih; } else { var ios_width = iw > ih ? iw : ih; } chgDiv.style.width = ios_width + 'px'; // console.log("iOS # 502", ios_width); // alert(ahost +" (iOS: "+iOS+" ==> "+ios_width+") "+ " >> " + window.screen.width + " >> " + iw + " >> " + window.parent.innerWidth +" >> "+ window.orientation + " >>> W:"+iw+" x H:"+ih) // } else { // chgDiv.style.width = window.parent.innerWidth + 'px'; // } } else { chgDiv.style.width = window.parent.screen.width + 'px'; } //console.log(window.screen.width + " " + chgDiv.style.width + " " + window.orientation); //console.log("parent inner width " + window.parent.innerWidth); //console.log(window.parent.document.documentElement.clientWidth); //console.log(window.parent.screen.width); }; if (parent.window.bar.bubble_effect) { jQuery('#' + parent.window.bar.pushdivid, window.parent.document).effect("bounce"); } var ipaddress = ""; jQuery.ajax({ dataType: "json", url: "https://api.ipify.org?format=jsonp&callback=?", success: (function( json ) { ipaddress = json.ip; jQuery.ajax({ type: "POST", url: window.rebeliqPathBaseUrl + "/loadstats.php", data: { hash: parent.window.bar.link_hash, hash_id: parent.window.bar.link_cid, load_key: parent.window.bar.load_key, crawlerbot: parent.window.bar.crawlerbot, ipaddress: json.ip, fullUrl: parent.window.bar.fullUrl }, success: (function( msg ) { // console.log(msg); }) }); }) }); jQuery('#linkanimation').on('click',function(e) { e.stopPropagation(); var home = this; var hasX = "no"; if (e.type == 'touchstart') { var touch = e.originalEvent.touches[0]; var x = touch.clientX; if(x != "undefined") { hasX = "yes"; } } else if (e.type == 'click') { var x = e.clientX; if(x != "undefined") { hasX = "yes"; } } jQuery.ajax({ type: "POST", url: window.rebeliqPathBaseUrl + "/clickstats.php", data: { load_key: parent.window.bar.load_key, crawlerbot: parent.window.bar.crawlerbot, ipaddress: ipaddress, hasx : hasX, }, success: (function( msg ) { // console.log(msg); }) }); }); jQuery('#hidden-st').on('click',function(e) { e.stopPropagation(); window.parent.hideStickyBar(); }); if(!jQuery("#linkanimation").hasClass("disable-hash")){ var thref = jQuery("#linkanimation").attr('href') + "?sticky=" + parent.window.bar.load_key; jQuery("#linkanimation").attr('href',thref); } });