/*window.onbeforeunload = function () { window.scrollTo(0, 0); }*/ jQuery(window).on('load', function(){ jQuery("#mask").fadeOut(1100); jQuery("body").css("overflow-y","scroll"); //jQuery( "#pre-approval-tab" ).trigger( "click" ); //jQuery('#lp_popmor_iframe1').attr('src' , jQuery('#pre-approval-tab').data('src')); }); var tab_trigger = true; var iframe_first_load_height = false; (function($) { "use strict"; jQuery('.tool-dt__item_first a').trigger('click'); jQuery(window).on('scroll', function() { if (jQuery(window).scrollTop() > 250 && tab_trigger){ jQuery('#pre-approval').removeClass('tab-pane_onload'); jQuery('.tool-dt__item_first a').trigger('click'); tab_trigger = false; iframe_first_load_height = true; } }); $(".dropdown-menu").hide(); jQuery('.navbar-toggle').click(function() { $('.lp-head-right').toggleClass("hide"); jQuery(".navigation-wrap_start").removeClass('no-transition'); jQuery('.menu-right').toggleClass('right-open'); jQuery('.navigation-wrap').toggleClass('navigation-wrap__open'); if (jQuery('.navigation-wrap').hasClass('navigation-wrap__open')) { $('.collapse__link_btn-apply-enable').css({'visibility':'hidden','transition': 'all .1s'}); jQuery(this).attr('aria-expanded', true); jQuery("html,body").css("overflow","hidden"); } else { $('.collapse__link_btn-apply-enable').delay('2000').css({'visibility':'visible','transition': 'all 2.5s'}); jQuery(this).attr('aria-expanded', false); jQuery("html,body").css("overflow-y","scroll"); } }); // if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { if (jQuery(window).width() <= 991) { jQuery('[data-toggle="tab"]').tooltip({ trigger: 'hover', placement: 'top', animate: true, delay: 500, container: 'body' }); jQuery('.dropdown').click(function(e) { e.stopPropagation(); if(jQuery(this).hasClass('open')){ var _this = jQuery(this); // _this.toggleClass('open'); jQuery(this).find('.dropdown-menu').stop().slideUp(300 , function(){ _this.removeClass('open'); }); }else{ jQuery('.dropdown-menu').slideUp('fast'); jQuery('.dropdown').delay(1500).removeClass('open'); jQuery(this).addClass('open'); jQuery(this).find('.dropdown-menu').stop().slideDown(); } }); jQuery('.collapse__link').click(function(e){ // e.stopPropagation(); }); // var header = $(".navigation-wrap_start"); // header.addClass("navigation-wrap_scroll-on_mobile"); } else { jQuery(".dropdown-menu").hide(); // menu item hover jQuery('.collapse__item.dropdown').mouseover(function() { jQuery(this).addClass('open'); jQuery(this).find('.dropdown-menu').stop().slideDown(); }).mouseleave(function() { var _this = jQuery(this); jQuery(this).find('.dropdown-menu').stop().slideUp(300, function() { _this.removeClass('open'); }); }); } jQuery('.lp_fancybox_iframe_link').click(function(e){ if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { var attr = $(this).attr('href'); if (typeof attr !== typeof undefined && attr !== false) { e.preventDefault(); window.open(attr, '_blank'); } } }); jQuery('a.tool-dt__link').on("click", function() { var wrap_hi = jQuery('.mobile_768').outerHeight(); if(jQuery(window).width() <= 768){ wrap_hi = 545; } if (jQuery(this).attr('data-loaded') == 'false') { _load_iframe_free_tools(this,wrap_hi); /*jQuery(".iframe-loader").show(); var iframe_id = jQuery(this).attr('data-iframe-id'); jQuery('#' + iframe_id).attr('src', jQuery(this).data("src").replace("##", wrap_hi)); jQuery(this).attr('data-loaded', 'true'); setTimeout(function(){ jQuery(".iframe-loader").hide(); }, 3000); jQuery('#' + iframe_id).load(function(){ if(jQuery(window).width() < 768){ // for thankyou page content var _content_height=jQuery('.tab-pane.active').find('iframe').contents().find('#outerWrapper').outerHeight(); if(!_content_height){ _content_height=jQuery('.tab-pane.active').find('iframe').contents().find('#main-wrapper').children('.content-wrapper').outerHeight(); } jQuery('.tab-pane.active').find('iframe').contents().find('#main-wrapper').height(_content_height); jQuery('#tool-dt__tab_Content').height(parseInt(_content_height + 15)); } });*/ }else{ var iframe_id = jQuery(this).attr('data-iframe-id'); // setTimeout(function(){ // if(iframe_first_load_height && jQuery(window).width() < 768) { // iframe_first_load_height = false; // var _content_height=jQuery('.tab-pane.active').find('iframe').contents().find('#outerWrapper').outerHeight(); // if(!_content_height){ // _content_height=jQuery('.tab-pane.active').find('iframe').contents().find('#main-wrapper').children('.content-wrapper').outerHeight(); // } // jQuery('.tab-pane.active').find('iframe').contents().find('#main-wrapper').height(_content_height); // if(_content_h != null) // jQuery('#tool-dt__tab_Content').height(parseInt(_content_height + 15)); // } // jQuery('.tab-pane.active').find('iframe').contents().find('#enteryourzipcode').focus(); // },1000); jQuery('a[data-toggle="tab"]').on('shown.bs.tab', function (e) { if(jQuery(window).width() < 768) { // for thankyou page content var _content_height=jQuery('.tab-pane.active').find('iframe').contents().find('#outerWrapper').outerHeight(); if(_content_height){ _load_iframe_free_tools(this,wrap_hi); }else{ if(!_content_height){ _content_height=jQuery('.tab-pane.active').find('iframe').contents().find('#main-wrapper').children('.content-wrapper').outerHeight(); } jQuery('.tab-pane.active').find('iframe').contents().find('#main-wrapper').height(_content_height); jQuery('.tab-pane.active').find('iframe').contents().find('#enteryourzipcode').focus(); if(_content_height != null) jQuery('#tool-dt__tab_Content').height(parseInt(_content_height + 15)); } }else{ var _content_height=jQuery('.tab-pane.active').find('iframe').contents().find('#outerWrapper').outerHeight(); if(_content_height){ _load_iframe_free_tools(this,wrap_hi); } } }); /*console.info('ID:'); console.info(jQuery('#' + iframe_id).contents()); console.info('postion:'+jQuery('iframe').contents().find('.main-header').outerHeight());*/ var tp = jQuery('iframe').contents().find('.main-header').outerHeight(); /*tp = tp - 50; if(tp < 0)tp = 0;*/ if(jQuery(window).width() <= 768){ tp = tp + 10; } jQuery('#' + iframe_id).contents().find(".mCSB_container").animate({top: '-' + tp}, 1000); jQuery('#' + iframe_id).contents().find(".mCSB_dragger").animate({top: tp - 50}, 1000); } }); })(jQuery); function _load_iframe_free_tools(targ_ele,wrap_hi){ jQuery(".iframe-loader").show(); var iframe_id = jQuery(targ_ele).attr('data-iframe-id'); jQuery('#' + iframe_id).attr('src', jQuery(targ_ele).data("src").replace("##", wrap_hi)); jQuery(targ_ele).attr('data-loaded', 'true'); jQuery('#' + iframe_id).load(function(){ if(jQuery(window).width() < 768){ // for thankyou page content var _content_height=jQuery('.tab-pane.active').find('iframe').contents().find('#outerWrapper').outerHeight(); if(!_content_height){ _content_height=jQuery('.tab-pane.active').find('iframe').contents().find('#main-wrapper').children('.content-wrapper').outerHeight(); } if(!_content_height){ _content_height=jQuery('.tab-pane.active').find('iframe').contents().find('#main-wrapper').find('.funnel-content').outerHeight(); } jQuery('.tab-pane.active').find('iframe').contents().find('#main-wrapper').height(_content_height); jQuery('#tool-dt__tab_Content').height(parseInt(_content_height + 15)); } jQuery(".iframe-loader").hide(); }); }