1jQuery(document).ready(function($){ 2 3 var adminBarHeight = 0; 4 if ( $("#wpadminbar").length != 0 ){ 5 var adminBarHeight = $('#wpadminbar').height(); 6 } 7 var mysticky_welcomebar_height = adminBarHeight + jQuery( '.mysticky-welcomebar-fixed' ).outerHeight(); 8 if( jQuery( '.mysticky-welcomebar-fixed' ).data('position') == 'top' ) { 9 jQuery( '.mysticky-welcomebar-entry-effect-slide-in.mysticky-welcomebar-fixed' ).css( 'top', '-' + mysticky_welcomebar_height + 'px' ); 10 } else { 11 jQuery( '.mysticky-welcomebar-entry-effect-slide-in.mysticky-welcomebar-fixed' ).css( 'bottom', '-' + mysticky_welcomebar_height + 'px' ); 12 } 13 var divi_topbar_height = $( '.et_fixed_nav #top-header' ).outerHeight(); 14 var divi_total_height = mysticky_welcomebar_height + divi_topbar_height; 15 var welcombar_aftersubmission = $( '.mysticky-welcomebar-fixed' ).data('aftersubmission'); 16 if( welcombar_aftersubmission == 'dont_show_welcomebar' ){ 17 var welcomebar_storage = localStorage.getItem("welcomebar_close"); 18 } else if( welcombar_aftersubmission == 'show_welcomebar_next_visit' ) { 19 var welcomebar_storage = sessionStorage.getItem("welcomebar_close"); 20 } else { 21 sessionStorage.removeItem('welcomebar_close'); 22 localStorage.removeItem('welcomebar_close'); 23 var welcomebar_storage = null; 24 } 25 if ( welcomebar_storage === null ){ 26 27 var after_trigger = jQuery( '.mysticky-welcomebar-fixed' ).data('after-triger'); 28 29 jQuery( 'body' ).addClass( 'mysticky-welcomebar-apper' ); 30 31 if ( after_trigger == 'after_a_few_seconds' ) { 32 33 if ( $( '.mysticky-welcomebar-fixed' ).hasClass( 'mysticky-welcomebar-display-desktop' ) ) { 34 if ( $( window ).width() > 767 ) { 35 var trigger_sec = jQuery( '.mysticky-welcomebar-fixed' ).data('triger-sec') * 1000; 36 var welcombar_position = $( '.mysticky-welcomebar-fixed' ).data('position'); 37 var welcombar_height = $( '.mysticky-welcomebar-fixed' ).outerHeight(); 38 39 setTimeout(function(){ 40 jQuery( '.mysticky-welcomebar-fixed' ).addClass( 'mysticky-welcomebar-animation' ); 41 $( '.mysticky-welcomebar-fixed' ).addClass( 'entry-effect' ); 42 if ( welcombar_position == 'top' ) { 43 44 jQuery( '.mysticky-welcomebar-fixed' ).addClass( 'mysticky-welcomebar-animation' ); 45 jQuery( '.mysticky-welcomebar-fixed' ).css( 'top', (adminBarHeight + 0) + 'px' ); 46 jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' ); 47 $( 'html' ).css( 'margin-bottom', '' ); 48 jQuery( '#mysticky_divi_style' ).remove(); 49 jQuery( '.et_fixed_nav #top-header' ).css( 'top', welcombar_height + 'px' ); 50 jQuery( 'head' ).append( '<style id="mysticky_divi_style" type="text/css">.et_fixed_nav #main-header {top: ' + welcombar_height + 'px !important}.et_fixed_nav #top-header + #main-header{top: ' + divi_total_height + 'px !important}</style>' ); 51 //$( 'html' ).attr( 'style', 'margin-top: ' + mysticky_welcomebar_height + 'px !important' ); 52 $("html").animate({ "margin-top": mysticky_welcomebar_height + "px" }, 1000, function() { 53 $("html").css("cssText", "margin-top:" + mysticky_welcomebar_height + "px!important;"); 54 }); 55 $( '#mysticky-nav' ).css( 'top', mysticky_welcomebar_height + 'px' ); 56 } else { 57 jQuery( '.mysticky-welcomebar-fixed' ).css( 'bottom', '0' ); 58 jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' ); 59 $( 'html' ).css( 'margin-top', '' ); 60 jQuery( '#mysticky_divi_style' ).remove(); 61 jQuery( '.et_fixed_nav #top-header' ).css( 'top', '' ); 62 $( 'html' ).attr( 'style', 'margin-bottom: ' + mysticky_welcomebar_height + 'px !important' ); 63 } 64 }, trigger_sec ); 65 } 66 } 67 } 68 if ( $( window ).width() < 767 ) { 69 if ( after_trigger == 'after_a_few_seconds' ) { 70 if ( $( '.mysticky-welcomebar-fixed' ).hasClass( 'mysticky-welcomebar-display-mobile' ) ) { 71 var trigger_sec = jQuery( '.mysticky-welcomebar-fixed' ).data('triger-sec') * 1000; 72 var welcombar_position = $( '.mysticky-welcomebar-fixed' ).data('position'); 73 var welcombar_height = $( '.mysticky-welcomebar-fixed' ).outerHeight(); 74 setTimeout(function(){ 75 jQuery( '.mysticky-welcomebar-fixed' ).addClass( 'mysticky-welcomebar-animation' ); 76 $( '.mysticky-welcomebar-fixed' ).addClass( 'entry-effect' ); 77 jQuery( '#mysticky_divi_style' ).remove();
78 jQuery( '.et_fixed_nav #top-header' ).css( 'top', '' ); 79 if ( welcombar_position == 'top' ) { 80 jQuery( '.mysticky-welcomebar-fixed' ).css( 'top', ( adminBarHeight + 0) + 'px' ); 81 jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' ); 82 $( 'html' ).css( 'margin-bottom', '' ); 83 //$( 'html' ).attr( 'style', 'margin-top: ' + mysticky_welcomebar_height + 'px !important' ); 84 $("html").animate({ "margin-top": mysticky_welcomebar_height + "px" }, 1000, function() { 85 $("html").css("cssText", "margin-top:" + mysticky_welcomebar_height + "px!important;"); 86 }); 87 $( '#mysticky-nav' ).css( 'top', mysticky_welcomebar_height + 'px' ); 88 } else { 89 jQuery( '.mysticky-welcomebar-fixed' ).css( 'bottom', '0' ); 90 jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' ); 91 $( 'html' ).css( 'margin-top', '' ); 92 $( 'html' ).attr( 'style', 'margin-bottom: ' + mysticky_welcomebar_height + 'px !important' ); 93 } 94 }, trigger_sec ); 95 } 96 } 97 } 98 mystickyelements_present(); 99 } 100 $( window ).resize( function(){ 101 102 var mysticky_welcomebar_height = jQuery( '.mysticky-welcomebar-fixed' ).outerHeight(); 103 if( welcombar_aftersubmission == 'dont_show_welcomebar' ){ 104 var welcomebar_storage = localStorage.getItem("welcomebar_close"); 105 } else if( welcombar_aftersubmission == 'show_welcomebar_next_visit' ) { 106 var welcomebar_storage = sessionStorage.getItem("welcomebar_close"); 107 } else { 108 sessionStorage.removeItem('welcomebar_close'); 109 localStorage.removeItem('welcomebar_close'); 110 var welcomebar_storage = null; 111 } 112 if ( welcomebar_storage === null ){ 113 var after_trigger = jQuery( '.mysticky-welcomebar-fixed' ).data('after-triger'); 114 if ( ! $( '.mysticky-welcomebar-fixed' ).hasClass( 'mysticky-welcomebar-notapper' ) ) { 115 jQuery( 'body' ).addClass( 'mysticky-welcomebar-apper' ); 116 } else { 117 jQuery( 'body' ).removeClass( 'mysticky-welcomebar-apper' ); 118 } 119 if ( after_trigger == 'after_a_few_seconds' ) { 120 var trigger_sec = jQuery( '.mysticky-welcomebar-fixed' ).data('triger-sec') * 1000; 121 var welcombar_position = $( '.mysticky-welcomebar-fixed' ).data('position'); 122 var welcombar_height = $( '.mysticky-welcomebar-fixed' ).outerHeight(); 123 if ( $( window ).width() < 767 ) { 124 if ( $( '.mysticky-welcomebar-fixed' ).hasClass( 'mysticky-welcomebar-display-mobile' ) ) { 125 setTimeout(function(){ 126 jQuery( '.mysticky-welcomebar-fixed' ).addClass( 'mysticky-welcomebar-animation' ); 127 $( '.mysticky-welcomebar-fixed' ).addClass( 'entry-effect' ); 128 jQuery( '#mysticky_divi_style' ).remove(); 129 jQuery( '.et_fixed_nav #top-header' ).css( 'top', '' ); 130 if ( welcombar_position == 'top' ) { 131 jQuery( '.mysticky-welcomebar-fixed' ).css( 'top', ( adminBarHeight + 0) + 'px' ); 132 jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' ); 133 $( 'html' ).css( 'margin-bottom', '' ); 134 //$( 'html' ).attr( 'style', 'margin-top: ' + mysticky_welcomebar_height + 'px !important' ); 135 $("html").animate({ "margin-top": mysticky_welcomebar_height + "px" }, 1000, function() { 136 $("html").css("cssText", "margin-top:" + mysticky_welcomebar_height + "px!important;"); 137 }); 138 $( '.mysticky-welcomebar-apper #mysticky-nav' ).css( 'top', mysticky_welcomebar_height + 'px' ); 139 } else { 140 jQuery( '.mysticky-welcomebar-fixed' ).css( 'bottom', '0' ); 141 jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' ); 142 $( 'html' ).css( 'margin-top', '' ); 143 $( 'html' ).attr( 'style', 'margin-bottom: ' + mysticky_welcomebar_height + 'px !important' ); 144 } 145 }, trigger_sec ); 146 } 147 } else { 148 if ( $( '.mysticky-welcomebar-fixed' ).hasClass( 'mysticky-welcomebar-display-desktop' ) ) { 149 setTimeout(function(){ 150 jQuery( '.mysticky-welcomebar-fixed' ).addClass( 'mysticky-welcomebar-animation' ); 151 $( '.mysticky-welcomebar-fixed' ).addClass( 'entry-effect' ); 152 if ( welcombar_position == 'top' ) {
153 jQuery( '.mysticky-welcomebar-fixed' ).css( 'top', ( adminBarHeight + 0) + 'px' ); 154 jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' ); 155 $( 'html' ).css( 'margin-bottom', '' ); 156 jQuery( '#mysticky_divi_style' ).remove(); 157 jQuery( '.mysticky-welcomebar-apper.et_fixed_nav #top-header' ).css( 'top', welcombar_height + 'px' ); 158 jQuery( 'head' ).append( '<style id="mysticky_divi_style" type="text/css">.mysticky-welcomebar-apper.et_fixed_nav #main-header {top: ' + welcombar_height + 'px !important}.mysticky-welcomebar-apper.et_fixed_nav #top-header + #main-header{top: ' + divi_total_height + 'px !important}</style>' ); 159 //$( 'html' ).attr( 'style', 'margin-top: ' + mysticky_welcomebar_height + 'px !important' ); 160 $("html").animate({ "margin-top": mysticky_welcomebar_height + "px" }, 1000, function() { 161 $("html").css("cssText", "margin-top:" + mysticky_welcomebar_height + "px!important;"); 162 }); 163 $( '.mysticky-welcomebar-apper #mysticky-nav' ).css( 'top', mysticky_welcomebar_height + 'px' ); 164 } else { 165 jQuery( '.mysticky-welcomebar-fixed' ).css( 'bottom', '0' ); 166 jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' ); 167 $( 'html' ).css( 'margin-top', '' ); 168 jQuery( '#mysticky_divi_style' ).remove(); 169 jQuery( '.et_fixed_nav #top-header' ).css( 'top', '' ); 170 $( 'html' ).attr( 'style', 'margin-bottom: ' + mysticky_welcomebar_height + 'px !important' ); 171 } 172 }, trigger_sec ); 173 } 174 } 175 } 176 mystickyelements_present(); 177 } 178 } ); 179 180 jQuery(window).on( 'scroll', function(){ 181 if( welcombar_aftersubmission == 'dont_show_welcomebar' ){ 182 var welcomebar_storage = localStorage.getItem("welcomebar_close"); 183 } else if( welcombar_aftersubmission == 'show_welcomebar_next_visit' ) { 184 var welcomebar_storage = sessionStorage.getItem("welcomebar_close"); 185 } else { 186 sessionStorage.removeItem('welcomebar_close'); 187 localStorage.removeItem('welcomebar_close'); 188 var welcomebar_storage = null; 189 } 190 if ( welcomebar_storage === null ){ 191 var welcombar_height = $( '.mysticky-welcomebar-fixed' ).outerHeight(); 192 var welcombar_position = $( '.mysticky-welcomebar-fixed' ).data('position'); 193 if ( welcombar_position == 'top' ) { 194 $( '#mysticky-nav' ).css( 'top', mysticky_welcomebar_height + 'px' ); 195 } 196 if ( after_trigger === 'after_scroll' ) { 197 var scroll = 100 * $(window).scrollTop() / ($(document).height() - $(window).height()); 198 var after_scroll_val = jQuery( '.mysticky-welcomebar-fixed' ).data('triger-sec'); 199 var welcombar_position = $( '.mysticky-welcomebar-fixed' ).data('position'); 200 var welcombar_height = $( '.mysticky-welcomebar-fixed' ).outerHeight(); 201 if( scroll > after_scroll_val ) { 202 if ( $( '.mysticky-welcomebar-fixed' ).hasClass( 'mysticky-welcomebar-display-desktop' ) ) { 203 if ( $( window ).width() > 767 ) { 204 jQuery( '.mysticky-welcomebar-fixed' ).addClass( 'mysticky-welcomebar-animation' ); 205 $( '.mysticky-welcomebar-fixed' ).addClass( 'entry-effect' ); 206 if ( welcombar_position == 'top' ) { 207 jQuery( '.mysticky-welcomebar-fixed' ).css( 'top', (adminBarHeight+ 0 ) + 'px' ); 208 jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' ); 209 $( 'html' ).css( 'margin-bottom', '' ); 210 //$( 'html' ).attr( 'style', 'margin-top: ' + mysticky_welcomebar_height + 'px !important' ); 211 $("html").animate({ "margin-top": mysticky_welcomebar_height + "px" }, 1000, function() { 212 $("html").css("cssText", "margin-top:" + mysticky_welcomebar_height + "px!important;"); 213 }); 214 $( '#mysticky-nav' ).css( 'top', mysticky_welcomebar_height + 'px' ); 215 } else { 216 jQuery( '.mysticky-welcomebar-fixed' ).css( 'bottom', '0' ); 217 jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' ); 218 $( 'html' ).css( 'margin-top', '' ); 219 $( 'html' ).attr( 'style', 'margin-bottom: ' + mysticky_welcomebar_height + 'px !important' ); 220 } 221 } 222 } 223 if ( $( '.mysticky-welcomebar-fixed' ).hasClass( 'mysticky-welcomebar-display-mobile' ) ) { 224 if ( $( window ).width() < 767 ) { 225 jQuery( '.mysticky-welcomebar-fixed' ).addClass( 'mysticky-welcomebar-animation' ); 226 $( '.mysticky-welcomebar-fixed' ).addClass( 'entry-effect' ); 227 if ( welcombar_position == 'top' ) {
228 jQuery( '.mysticky-welcomebar-fixed' ).css( 'top', ( adminBarHeight +0 ) + 'px' ); 229 jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' ); 230 $( 'html' ).css( 'margin-bottom', '' ); 231 //$( 'html' ).attr( 'style', 'margin-top: ' + mysticky_welcomebar_height + 'px !important' ); 232 $("html").animate({ "margin-top": mysticky_welcomebar_height + "px" }, 1000, function() { 233 $("html").css("cssText", "margin-top:" + mysticky_welcomebar_height + "px!important;"); 234 }); 235 $( '#mysticky-nav' ).css( 'top', mysticky_welcomebar_height + 'px' ); 236 } else { 237 jQuery( '.mysticky-welcomebar-fixed' ).css( 'bottom', '0' ); 238 jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' ); 239 $( 'html' ).css( 'margin-top', '' ); 240 $( 'html' ).attr( 'style', 'margin-bottom: ' + mysticky_welcomebar_height + 'px !important' ); 241 } 242 } 243 } 244 } 245 } 246 mystickyelements_present(); 247 } 248 249 }); 250 251 jQuery( '.mysticky-welcomebar-close, .mysticky-welcomebar-btn a' ).on( 'click', function(e){ 252 if ($(this).attr('href') == '') { 253 e.preventDefault(); 254 } 255 /* Submit contact lead form */ 256 var flag = true; 257 var trigger_sec = 100; 258 var welcomebar_widget = 0; 259 if( jQuery(".mysticky-welcomebar-lead-content").length > 0 && !$(this).hasClass("mysticky-welcomebar-close")){ 260 261 if( jQuery('#contact-lead-name-'+welcomebar_widget).val() != '' && ( jQuery('#contact-lead-phone-'+welcomebar_widget).val() != '' || jQuery('#contact-lead-email-'+welcomebar_widget).val() != '' )){ 262 263 if( jQuery('#contact-lead-email-'+welcomebar_widget).css("display") != 'none' && IsEmail(jQuery('#contact-lead-email-'+welcomebar_widget).val()) != true ){ 264 265 if( $(".input-error").length ){ 266 $(".input-error").remove(); 267 } 268 269 $( '<div class="input-error"><span>Please, enter valid email</span></div>' ).insertAfter( jQuery('#contact-lead-email-' + welcomebar_widget) ); 270 flag = false; 271 } 272 273 274 if( jQuery('#contact-lead-phone-'+welcomebar_widget).css("display") != 'none' && validatePhone(jQuery('#contact-lead-phone-'+welcomebar_widget).val()) != true ){ 275 if( $(".input-error").length ){ 276 $(".input-error").remove(); 277 } 278 $( '<div class="input-error"><span>Please, enter valid phone</span></div>' ).insertAfter( jQuery('#contact-lead-phone-'+welcomebar_widget) ); 279 flag=false; 280 } 281 282 if (flag == true) { 283 var data = []; 284 data["contact_name"] = jQuery('#contact-lead-name-'+welcomebar_widget).val(); 285 data["contact_email"] = jQuery('#contact-lead-email-'+welcomebar_widget).val(); 286 data["contact_phone"] = jQuery('#contact-lead-phone-'+welcomebar_widget).val(); 287 data["contact_page_link"] = jQuery('#contact-lead-pagelink-'+welcomebar_widget).val(); 288 289 290 var sucess_message = $( '.mysticky-welcomebar-fixed' ).data('show-success-message'); 291 if ( sucess_message == 1) { 292 $(".mysticky-welcomebar-fixed .mysticky-welcomebar-lead-content").hide(); 293 $(".mysticky-welcomebar-fixed .mysticky-welcomebar-content p").hide(); 294 $(".mysticky-welcomebar-fixed .mysticky-welcomebar-btn.contact-lead-button").hide(); 295 $(".mysticky-welcomebar-fixed .mysticky-welcomebar-thankyou-content").show(); 296 $(".mysticky-welcomebar-fixed .mysticky-welcomebar-thankyou-content p").show(); 297 } 298 var trigger_sec = 2000; 299 jQuery.ajax({ 300 url: welcomebar_frontjs.ajaxurl, 301 type:'post', 302 data: 'contact_name='+data["contact_name"]+'&contact_email='+data["contact_email"]+'&contact_phone='+data["contact_phone"]+'&action=stickymenu_contact_lead_form&widget_id=' + welcomebar_widget + '&page_link='+ data["contact_page_link"]+'&save_form_lead=1&wpnonce=' + welcomebar_frontjs.ajax_nonce, 303 success: function( data ){ 304 $(".mysticky-welcomebar-widget-"+welcomebar_widget+" .mysticky-welcomebar-fixed-wrap").css("margin-bottom","0"); 305 jQuery('#contact-lead-name-'+welcomebar_widget).val(''); 306 jQuery('#contact-lead-email-'+welcomebar_widget).val(''); 307 jQuery('#contact-lead-phone-'+welcomebar_widget).val(''); 308 309 }, 310 }); 311 }else{ 312 $(".mysticky-welcomebar-widget-"+welcomebar_widget+" .mysticky-welcomebar-fixed-wrap").css("margin-bottom","10px"); 313 return false;
314 } 315 316 317 }else{ 318 localStorage.removeItem('welcomebar_close_' + welcomebar_widget); 319 sessionStorage.removeItem('welcomebar_close_' + welcomebar_widget); 320 321 if($(".input-error").length){ 322 $(".input-error").remove(); 323 } 324 325 if( jQuery('#contact-lead-name-'+welcomebar_widget).css("display") != 'none' && jQuery('#contact-lead-name-'+welcomebar_widget).val() == '' && jQuery('#contact-lead-email-'+welcomebar_widget).css("display") != 'none' && jQuery('#contact-lead-email-'+welcomebar_widget).val() == '' ){ 326 327 $( '<div class="input-error"><span>Please enter your name and email</span></div>' ).insertAfter( jQuery('#contact-lead-name-'+welcomebar_widget) ); 328 flag=false; 329 330 }else if( jQuery('#contact-lead-name-'+welcomebar_widget).css("display") != 'none' && jQuery('#contact-lead-name-'+welcomebar_widget).val() == '' && jQuery('#contact-lead-phone-'+welcomebar_widget).css("display") != 'none' && jQuery('#contact-lead-phone-'+welcomebar_widget).val() == '' ){ 331 332 $( '<div class="input-error"><span>Please enter your name and phone</span></div>' ).insertAfter( jQuery('#contact-lead-name-'+welcomebar_widget) ); 333 flag=false; 334 335 }else if( jQuery('#contact-lead-name-'+welcomebar_widget).css("display") != 'none' && jQuery('#contact-lead-name-'+welcomebar_widget).val() == '' ){ 336 337 $( '<div class="input-error"><span>Please enter your name</span></div>' ).insertAfter( jQuery('#contact-lead-name-'+welcomebar_widget) ); 338 flag=false; 339 340 }else if( jQuery('#contact-lead-email-'+welcomebar_widget).css("display") != 'none' && jQuery('#contact-lead-email-'+welcomebar_widget).val() == '' ){ 341 342 $( '<div class="input-error"><span>Please, enter your email</span></div>' ).insertAfter( jQuery('#contact-lead-email-'+welcomebar_widget) ); 343 flag=false; 344 345 }else if( jQuery('#contact-lead-phone-'+welcomebar_widget).css("display") != 'none' && jQuery('#contact-lead-phone-'+welcomebar_widget).val() == '' ){ 346 347 $( '<div class="input-error"><span>Please, enter your phone</span></div>' ).insertAfter( jQuery('#contact-lead-phone-'+welcomebar_widget) ); 348 flag=false; 349 350 } 351 352 if(flag==false){ 353 354 $(".mysticky-welcomebar-widget-"+welcomebar_widget+" .mysticky-welcomebar-fixed-wrap").css("margin-bottom","10px"); 355 } else{ 356 $(".mysticky-welcomebar-widget-"+welcomebar_widget+" .mysticky-welcomebar-fixed-wrap").css("margin-bottom","0"); 357 } 358 return false; 359 } 360 }else{ 361 if( $(this).hasClass("mysticky-welcomebar-close") ){ 362 localStorage.setItem('is_close_trigger_' + welcomebar_widget, 'yes'); 363 } 364 } 365 366 setTimeout(function(){ 367 if( welcombar_aftersubmission != 'show_welcomebar_every_page' ){ 368 if( welcombar_aftersubmission == 'dont_show_welcomebar' ){ 369 sessionStorage.removeItem('welcomebar_close'); 370 localStorage.setItem('welcomebar_close', 'close'); 371 } else if( welcombar_aftersubmission == 'show_welcomebar_next_visit' ) { 372 localStorage.removeItem('welcomebar_close'); 373 sessionStorage.setItem('welcomebar_close', 'close'); 374 } 375 } 376 var welcombar_position = $( '.mysticky-welcomebar-fixed' ).data('position'); 377 var welcombar_height = $( '.mysticky-welcomebar-fixed' ).outerHeight(); 378 jQuery( '.mysticky-welcomebar-fixed' ).addClass( 'mysticky-welcomebar-notapper' ); 379 jQuery( 'body' ).removeClass( 'mysticky-welcomebar-apper' ); 380 jQuery( '.mysticky-welcomebar-fixed' ).slideUp( 'slow' ); 381 if ( welcombar_position == 'top' ) { 382 jQuery( '.mysticky-welcomebar-fixed' ).css( 'top', '-' + mysticky_welcomebar_height + 'px' ); 383 } else { 384 jQuery( '.mysticky-welcomebar-fixed' ).css( 'bottom', '-' + mysticky_welcomebar_height + 'px' ); 385 } 386 jQuery( '#mysticky_divi_style' ).remove(); 387 jQuery( '.et_fixed_nav #top-header' ).css( 'top', '' ); 388 jQuery( 'html' ).css( 'margin-top', '' ); 389 jQuery( 'html' ).css( 'margin-bottom', '' ); 390 $( '#mysticky-nav' ).css( 'top', '0px' ); 391 /*if mystickyelements show*/ 392 var mystickyelements_show = $( '.mystickyelements-fixed' ).length; 393 if( mystickyelements_show && $( window ).width() <= 1024 && $( '.mystickyelements-fixed' ).hasClass( 'mystickyelements-position-mobile-top' ) && welcombar_position == 'top' ) {
394 var mystickyelements_height = $( '.mystickyelements-fixed' ).height(); 395 $( '.mystickyelements-fixed' ).css( 'top', '' ); 396 //$( 'html' ).attr( 'style', 'margin-top: ' + mystickyelements_height + 'px !important' ); 397 $("html").animate({ "margin-top": mystickyelements_height + "px" }, 1000, function() { 398 $("html").css("cssText", "margin-top:" + mystickyelements_height + "px!important;"); 399 }); 400 } 401 402 }, trigger_sec ); 403 jQuery('#contact-lead-name-'+welcomebar_widget).val(''); 404 jQuery('#contact-lead-email-'+welcomebar_widget).val(''); 405 jQuery('#contact-lead-phone-'+welcomebar_widget).val(''); 406 } ); 407 408 // JS snippet to allow close button to work with keyboard. 409 $('.mysticky-welcomebar-close').on('keydown', function(e) { 410 if(e.keyCode == '13'){ 411 $(this).trigger('click'); 412 } 413 }); 414}); 415function mystickyelements_present() { 416 var after_trigger = jQuery( '.mysticky-welcomebar-fixed' ).data('after-triger'); 417 var mystickyelements_show = jQuery( '.mystickyelements-fixed' ).length; 418 var welcombar_position = jQuery( '.mysticky-welcomebar-fixed' ).data('position'); 419 var adminBarHeight = 0; 420 if ( jQuery("#wpadminbar").length != 0 ){ 421 var adminBarHeight = jQuery('#wpadminbar').height(); 422 } 423 424 if ( jQuery( window ).width() <= 600 && jQuery(window).scrollTop() != 0 && welcombar_position == 'top') { 425 jQuery( '.mysticky-welcomebar-fixed' ).css( 'top', '0px' ); 426 var welcombar_height = jQuery( '.mysticky-welcomebar-fixed' ).outerHeight(); 427 428 if (jQuery( '.mysticky-welcomebar-fixed' ).css('display') === 'none') { 429 welcombar_height= 0; 430 } 431 jQuery( '#mysticky-nav' ).css( 'top', welcombar_height + 'px' ); 432 433 } else if ( welcombar_position == 'top' ) { 434 var mysticky_welcomebar_height = adminBarHeight + jQuery( '.mysticky-welcomebar-fixed' ).outerHeight(); 435 if (jQuery( '.mysticky-welcomebar-fixed' ).css('display') === 'none') { 436 mysticky_welcomebar_height= adminBarHeight + 0; 437 } 438 jQuery( '.mysticky-welcomebar-fixed' ).css( 'top', ( adminBarHeight + 0) + 'px' ); 439 jQuery( '#mysticky-nav' ).css( 'top', mysticky_welcomebar_height + 'px' ); 440 } 441 if( mystickyelements_show ) { 442 443 var welcombar_height = jQuery( '.mysticky-welcomebar-fixed' ).outerHeight(); 444 var mystickyelements_height = jQuery( '.mystickyelements-fixed' ).height(); 445 var mystickyelements_total_height = welcombar_height + mystickyelements_height; 446 if ( jQuery( window ).width() <= 1024 && jQuery( '.mystickyelements-fixed' ).hasClass( 'mystickyelements-position-mobile-top' ) ) { 447 if ( after_trigger == 'after_a_few_seconds' ) { 448 if ( jQuery( '.mysticky-welcomebar-fixed' ).hasClass( 'mysticky-welcomebar-display-mobile' ) ) { 449 var trigger_sec = jQuery( '.mysticky-welcomebar-fixed' ).data('triger-sec') * 1000; 450 setTimeout(function(){ 451 if ( welcombar_position == 'top' ) { 452 jQuery( '.mystickyelements-fixed' ).css( 'top', welcombar_height ); 453 //jQuery( 'html' ).attr( 'style', 'margin-top: ' + mystickyelements_total_height + 'px !important' ); 454 $("html").animate({ "margin-top": mystickyelements_total_height + "px" }, 1000, function() { 455 $("html").css("cssText", "margin-top:" + mystickyelements_total_height + "px!important;"); 456 }); 457 } else { 458 jQuery( '.mystickyelements-fixed' ).css( 'top', '' ); 459 jQuery( 'html' ).attr( 'style', 'margin-bottom: ' + welcombar_height + 'px !important' ); 460 } 461 }, trigger_sec ); 462 } 463 } else if ( after_trigger === 'after_scroll' ) { 464 var scroll = 100 * $(window).scrollTop() / ($(document).height() - $(window).height()); 465 var after_scroll_val = $( '.mysticky-welcomebar-fixed' ).data('triger-sec'); 466 if( scroll > after_scroll_val ) { 467 if ( jQuery( '.mysticky-welcomebar-fixed' ).hasClass( 'mysticky-welcomebar-display-mobile' ) ) { 468 if ( welcombar_position == 'top' ) { 469 jQuery( '.mystickyelements-fixed' ).css( 'top', welcombar_height ); 470 //jQuery( 'html' ).attr( 'style', 'margin-top: ' + mystickyelements_total_height + 'px !important' ); 471 $("html").animate({ "margin-top": mystickyelements_total_height + "px" }, 1000, function() { 472 $("html").css("cssText", "margin-top:" + mystickyelements_total_height + "px!important;"); 473 }); 474 } else {
475 jQuery( '.mystickyelements-fixed' ).css( 'top', '' ); 476 jQuery( 'html' ).attr( 'style', 'margin-bottom: ' + welcombar_height + 'px !important' ); 477 } 478 } 479 } 480 } 481 } 482 } 483} 484jQuery(".mysticky-welcomebar-fixed").on( 485 "animationend MSAnimationEnd webkitAnimationEnd oAnimationEnd", 486 function() { 487 jQuery(this).removeClass("animation-start"); 488 } 489); 490jQuery(document).ready(function() { 491 var container = jQuery(".mysticky-welcomebar-fixed"); 492 var refreshId = setInterval(function() { 493 container.addClass("animation-start"); 494 }, 3500); 495}); 496 497function IsEmail(email) { 498 var regex = 499/^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; 500 if (!regex.test(email)) { 501 return false; 502 } 503 else { 504 return true; 505 } 506} 507 508function validatePhone(txtPhone) { 509 var a = txtPhone; 510 var filter = /^((\+[1-9]{1,4}[ \-]*)|(\([0-9]{2,3}\)[ \-]*)|([0-9]{2,4})[ \-]*)*?[0-9]{3,4}?[ \-]*[0-9]{3,4}?$/; 511 if (filter.test(a)) { 512 return true; 513 } 514 else { 515 return false; 516 } 517}
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.