1jQuery( document ).ready( function($){ 2 var x = ''; 3 var adminBarHeight = 0; 4 if ( $("#wpadminbar").length != 0 ){ 5 adminBarHeight = $('#wpadminbar').height(); 6 } 7 jQuery( '.welcomebar-hidden-sliding-text' ).each( function(){ 8 var sliding_text_width = jQuery(this).outerWidth(); 9 var sliding_text_height = jQuery(this).outerHeight(); 10 //console.log( sliding_text_width + " =="+ sliding_text_height + " == "+ /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)); 11 if(!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) { 12 jQuery(this).parent().css('min-width', sliding_text_width + 'px'); 13 } 14 jQuery(this).parent().css('min-height', sliding_text_height + 'px'); 15 }); 16 17 /* On Load to check Welcome bar widget to appear */ 18 19 jQuery( '.mysticky-welcomebar-fixed' ).each( function(){ 20 var welcomebar_widget = jQuery( this ).data( 'welcomebar-widget' ); 21 22 if( jQuery( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).data('position') == 'top' ) { 23 jQuery( '.mysticky-welcomebar-entry-effect-slide-in.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).css( 'top', '-' + $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).outerHeight() + 'px' ); 24 } else { 25 jQuery( '.mysticky-welcomebar-entry-effect-slide-in.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).css( 'bottom', '-' + $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).outerHeight() + 'px' ); 26 } 27 28 var welcombar_aftersubmission = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).data('aftersubmission'); 29 if( welcombar_aftersubmission == 'dont_show_welcomebar' ){ 30 var welcomebar_storage = localStorage.getItem("welcomebar_close_" + welcomebar_widget); 31 } else if( welcombar_aftersubmission == 'show_welcomebar_next_visit' ) { 32 var welcomebar_storage = sessionStorage.getItem("welcomebar_close_" + welcomebar_widget); 33 } else { 34 sessionStorage.removeItem('welcomebar_close_' + welcomebar_widget); 35 localStorage.removeItem('welcomebar_close_' + welcomebar_widget); 36 var welcomebar_storage = null; 37 } 38 var is_close_trigger = localStorage.getItem("is_close_trigger_" + welcomebar_widget); 39 var is_button_trigger = localStorage.getItem("is_button_trigger_" + welcomebar_widget); 40 41 if(jQuery(this).data("isenablecoupon") == 1 && welcomebar_storage !== null && jQuery(this).data("btn-click-action") == 'show_coupon' && is_close_trigger == null && is_button_trigger == 'yes'){ 42 welcomebar_storage = null; 43 jQuery(this).find(".mysticky-welcomebar-content").hide(); 44 jQuery(this).find(".mysticky-welcomebar-btn").hide(); 45 jQuery(this).find(".mysticky-couponbar-content").show(); 46 jQuery(".mysticky-welcomebar-widget-"+welcomebar_widget + " .count-down-timer-box").hide(); 47 48 if( jQuery(".mysticky-welcomebar-fixed.mysticky-welcomebar-widget-"+welcomebar_widget+" .mysticky-welcomebar-lead-content").length > 0 ){ 49 jQuery(".mysticky-welcomebar-fixed.mysticky-welcomebar-widget-"+welcomebar_widget+" .mysticky-welcomebar-lead-content").hide(); 50 } 51 } 52 53 if ( welcomebar_storage === null ){ 54 var after_trigger = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).data('after-triger'); 55 if ( after_trigger == 'after_a_few_seconds' ) { 56 if ( $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).hasClass( 'mysticky-welcomebar-display-desktop' ) ) { 57 if ( $( window ).width() > 1024 ) { 58 var trigger_sec = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).data('triger-sec') * 1000; 59 var welcombar_position = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).data('position'); 60 var welcombar_height = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).outerHeight(); 61 var divi_topbar_height = $( '.et_fixed_nav #top-header' ).outerHeight(); 62 var divi_total_height = welcombar_height + divi_topbar_height; 63 64 setTimeout(function(){ 65 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).addClass( 'mysticky-welcomebar-animation' ); 66 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).addClass( 'entry-effect' ); 67 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).removeClass( 'mysticky-welcomebar-notpresent' ); 68 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget + ' .mysticky-welcomebar-animation-text' ).morphext(); 69 $( 'html,body' ).addClass( 'mysticky-welcomebar-apper' ); 70 var new_welcombar_height_top = new_welcombar_height_bottom = new_welcombar_margin_top = new_welcombar_padding_bottom = 0; 71 /*set welcomebar position when welcombar display*/ 72 $( '.mysticky-welcomebar-fixed' ).not( ".mysticky-welcomebar-notpresent" ).each( function( index ){ 73
74 var welcomebar_widget_index = $( this ).data( 'welcomebar-widget' ); 75 76 var welcomebar_widget_ready = $( this ).data( 'welcomebar-widget' ); 77 var welcombar_position_ready = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget_ready ).data( 'position' ); 78 var welcombar_height_ready = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget_ready ).outerHeight(); 79 80 if( ! $( this ).hasClass( 'mysticky-welcomebar-notpresent' ) && ! $( this ).hasClass( 'mysticky-welcomebar-notapper' ) ) { 81 if ( welcombar_position_ready == 'top' ) { 82 83 var new_welcombar_position = adminBarHeight + welcomebar_widget_index + new_welcombar_height_top; 84 if( index != 0 ){ 85 var new_welcombar_position = 0 + new_welcombar_height_top; 86 } else { 87 var new_welcombar_position = adminBarHeight + 0 + new_welcombar_height_top; 88 } 89 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget_ready ).css( 'top', new_welcombar_position ); 90 $( '.et_fixed_nav #top-header' ).css( 'top', new_welcombar_position + 'px' ); 91 new_welcombar_height_top = new_welcombar_position + $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget_ready ).outerHeight(); 92 93 var new_welcomebar_height = adminBarHeight + welcombar_height_ready + new_welcombar_margin_top; 94 $( 'html.mysticky-welcomebar-apper' ).attr( 'style', 'margin-top: ' + new_welcomebar_height + 'px !important' ); 95 $( '#mysticky-nav' ).css( 'top', new_welcomebar_height + 'px' ); 96 new_welcombar_margin_top = new_welcombar_margin_top + $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget_ready ).outerHeight(); 97 } else { 98 var new_welcombar_position = 0 + new_welcombar_height_bottom; 99 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget_ready ).css( 'bottom', new_welcombar_position ); 100 new_welcombar_height_bottom = new_welcombar_position + $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget_ready ).outerHeight(); 101 102 var new_welcomebar_height = welcombar_height_ready + new_welcombar_padding_bottom; 103 $( 'head' ).append( '<style class="mysticky_bottom_style" type="text/css">html.mysticky-welcomebar-apper {padding-bottom: ' + new_welcomebar_height + 'px}</style>' ); 104 new_welcombar_padding_bottom = new_welcombar_padding_bottom + $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget_ready ).outerHeight(); 105 } 106 } 107 108 } ); 109 110 if ( welcombar_position == 'top' ) { 111 $( '#mysticky_divi_style' ).remove(); 112 113 $( '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>' ); 114 115 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).css( 'opacity', '1' ); 116 117 } else { 118 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).css( 'opacity', '1' ); 119 $( '#mysticky_divi_style' ).remove(); 120 $( '.et_fixed_nav #top-header' ).css( 'top', '' ); 121 } 122 123 //mysticky_welcombar_automatically_close( welcomebar_widget ); 124 125 }, trigger_sec ); 126 } 127 } 128 } 129 if ( $( window ).width() <= 1024 ) { 130 if ( after_trigger == 'after_a_few_seconds' ) { 131 if ( $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).hasClass( 'mysticky-welcomebar-display-mobile' ) ) { 132 var trigger_sec = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).data('triger-sec') * 1000; 133 var welcombar_position = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).data('position'); 134 var welcombar_height = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).outerHeight(); 135 setTimeout(function(){ 136 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).addClass( 'mysticky-welcomebar-animation' ); 137 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).addClass( 'entry-effect' ); 138 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).removeClass( 'mysticky-welcomebar-notpresent' ); 139 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget + ' .mysticky-welcomebar-animation-text' ).morphext(); 140 $( 'html,body' ).addClass( 'mysticky-welcomebar-apper' ); 141 $( '#mysticky_divi_style' ).remove();
142 $( '.et_fixed_nav #top-header' ).css( 'top', '' ); 143 144 var new_welcombar_height_top = new_welcombar_height_bottom = new_welcombar_margin_top = new_welcombar_padding_bottom = 0; 145 146 /*set welcomebar position when welcombar display*/ 147 $( '.mysticky-welcomebar-fixed' ).not( ".mysticky-welcomebar-notpresent" ).each( function( index ){ 148 var welcomebar_widget_ready = $( this ).data( 'welcomebar-widget' ); 149 var welcombar_position_ready = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget_ready ).data( 'position' ); 150 var welcombar_height_ready = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget_ready ).outerHeight(); 151 152 if( ! $( this ).hasClass( 'mysticky-welcomebar-notpresent' ) && ! $( this ).hasClass( 'mysticky-welcomebar-notapper' ) ) { 153 if ( welcombar_position_ready == 'top' ) { 154 if( index == 0 ){ 155 var new_welcombar_position = 0 + adminBarHeight + new_welcombar_height_top; 156 var new_welcomebar_height = welcombar_height_ready + adminBarHeight + new_welcombar_margin_top; 157 }else{ 158 var new_welcombar_position = 0 + new_welcombar_height_top; 159 var new_welcomebar_height = welcombar_height_ready + new_welcombar_margin_top + adminBarHeight; 160 } 161 162 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget_ready ).css( 'top', new_welcombar_position ); 163 $( '.et_fixed_nav #top-header' ).css( 'top', new_welcombar_position + 'px' ); 164 new_welcombar_height_top = new_welcombar_position + $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget_ready ).outerHeight(); 165 $( 'html.mysticky-welcomebar-apper' ).attr( 'style', 'margin-top: ' + ( new_welcomebar_height ) + 'px !important' ); 166 $( '#mysticky-nav' ).css( 'top', new_welcomebar_height + 'px' ); 167 new_welcombar_margin_top = new_welcombar_margin_top + $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget_ready ).outerHeight(); 168 } else { 169 var new_welcombar_position = 0 + new_welcombar_height_bottom; 170 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget_ready ).css( 'bottom', new_welcombar_position ); 171 new_welcombar_height_bottom = new_welcombar_position + $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget_ready ).outerHeight(); 172 173 var new_welcomebar_height = welcombar_height_ready + new_welcombar_padding_bottom; 174 $( 'head' ).append( '<style class="mysticky_bottom_style" type="text/css">html.mysticky-welcomebar-apper {padding-bottom: ' + new_welcomebar_height + 'px}</style>' ); 175 new_welcombar_padding_bottom = new_welcombar_padding_bottom + $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget_ready ).outerHeight(); 176 } 177 } 178 179 } ); 180 181 if ( welcombar_position == 'top' ) { 182 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).addClass( 'mysticky-welcomebar-animation' ); 183 184 $( '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>' ); 185 186 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).css( 'opacity', '1' ); 187 188 } else { 189 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).css( 'opacity', '1' ); 190 $( '.et_fixed_nav #top-header' ).css( 'top', '' ); 191 } 192 193 //mysticky_welcombar_automatically_close( welcomebar_widget ); 194 }, trigger_sec ); 195 } 196 } 197 } 198 199 mystickyelements_present( welcomebar_widget ); 200 } 201 202 /* 203 mysticky menu: Countdown Timer function initialize 204 */ 205 206 jQuery('.count-down-timer-box').each(function(){ 207 208 var timerBgColor = $(this).data('timerbgcolor'); 209 var timerTxtColor = $(this).data('timertxtcolor'); 210 var welcomebarTextColor = $(this).data('welcombar-textcolor'); 211 var divId = "#"+$(this).attr('id'); 212 var expiredDate = ''; 213 var expiredTime = ''; 214 var timer_from = $(this).data('timerfrom'); 215 var timezone = ''; 216 var data_endTime = ''; 217 218 if(timer_from == 'timer_apperance'){
219 220 expiredDate = $(this).data('enddate'); 221 expiredTime = $(this).data('endtime'); 222 expiredDate = new Date(expiredDate + ' ' + expiredTime); 223 data_endTime = $(this).data('endtime'); 224 timezone = $(this).data('timezone'); 225 }else{ 226 expiredDate = new Date(); 227 var expirHour = $(this).data('hour'); 228 var expirMinute = $(this).data('minute'); 229 var expirSecond = $(this).data('second'); 230 var expire_time = readMyStickyMenuCookie('welcombar-countdowntime-'+ welcomebar_widget); 231 232 if( expire_time != null ) { 233 expiredDate = new Date(expire_time); 234 } else { 235 createMyStickyMenuCookie('welcombar-countdowntime-'+ welcomebar_widget, expiredDate, 1); 236 } 237 238 expirHour = parseInt(expirHour) + parseInt(expiredDate.getHours()); 239 expirMinute = parseInt(expirMinute) + parseInt(expiredDate.getMinutes()); 240 expirSecond = parseInt(expirSecond) + parseInt(expiredDate.getSeconds() + 2); 241 242 243 var trigger_sec = ( $(".mysticky-welcomebar-widget-"+welcomebar_widget).data("triger-sec") != '' && $( ".mysticky-welcomebar-widget-"+welcomebar_widget ).data("after-triger") == 'after_a_few_seconds' ) ? $(".mysticky-welcomebar-widget-"+welcomebar_widget).data("triger-sec") : '3'; 244 245 expirSecond = expirSecond + parseInt(trigger_sec); 246 //expirSecond = ( expirSecond > 60 ) ? expirSecond - : expirSecond; 247 expiredDate.setHours(parseInt(expirHour)); 248 expiredDate.setMinutes(parseInt(expirMinute)); 249 expiredDate.setSeconds(parseInt(expirSecond)); 250 } 251 252 var num = /^[-+]?[0-9]+\.[0-9]+$/; 253 var plus_number = /^[-+]?[0-9]+$/; 254 timezone = timezone.toString().replace("-", ""); 255 256 if(expiredDate == 'Invalid Date'){ 257 jQuery(window).trigger('resize'); 258 jQuery(divId).html(""); 259 return; 260 } 261 262 /* For Set Time out to check counter div class appear or not */ 263 var checkTimerSet = setInterval(function(){ 264 if(jQuery(divId + " .counter-main-block").length > 0){ 265 jQuery(window).trigger('resize'); 266 clearInterval(checkTimerSet); 267 } 268 269 },1000); 270 271 var timer = setInterval(function(){ 272 var position = 0; 273 if ( $('.mysticky-welcomebar-widget-' + welcomebar_widget).hasClass( 'mysticky-welcomebar-position-top' ) ) { 274 position = parseInt($('.mysticky-welcomebar-widget-' + welcomebar_widget).css('top')); 275 } 276 if ( $('.mysticky-welcomebar-widget-' + welcomebar_widget).hasClass( 'mysticky-welcomebar-position-bottom' ) ) { 277 position = parseInt($('.mysticky-welcomebar-widget-' + welcomebar_widget).css('bottom')); 278 } 279 280 if ( position >= 0 ) { 281 var nowDate = new Date(); 282 if(timer_from == 'timer_apperance'){ 283 if( num.test(timezone) == true || plus_number.test(timezone) == true ) { 284 nowDate = getCurrentDateTimeGMT(timezone) 285 }else{ 286 nowDate = new Date(nowDate.toLocaleString('en-US', {timeZone: timezone})); 287 } 288 } 289 290 var hourss = Math.abs(expiredDate.getTime() - nowDate.getTime()) / 3600000; 291 var diffrenceDate = expiredDate - nowDate; 292 var diffrenceDate = expiredDate - nowDate; 293 294 if(diffrenceDate < 0){ 295 jQuery(window).trigger('resize'); 296 jQuery(divId).html(""); 297 clearInterval(timer); 298 return; 299 } 300 var days = Math.floor(diffrenceDate / (1000*60*60*24)); 301 var hours = Math.floor((diffrenceDate % (1000*60*60*24))/ (1000*60*60)); 302 var minute = Math.floor((diffrenceDate %(1000*60*60)) / (1000*60)); 303 var seconds = Math.floor((diffrenceDate %(1000*60)) / 1000); 304 if ( Math.floor(hourss) == 24 ) { 305 hours= Math.floor(hourss); 306 days = 0; 307 } 308 309 days = (days > 9) ? days : '0' + days; 310 hours = (hours > 9) ? hours : '0' + hours; 311 minute = (minute > 9) ? minute : '0' + minute; 312 seconds = (seconds > 9) ? seconds : '0' + seconds; 313 314 if(timer_from == 'timer_apperance'){ 315 if(days == 0 && hours == 0 && minute == 0 && seconds == 0){ 316 jQuery(rightDivId).html(""); 317 }else{ 318 jQuery(divId).html( "<div class='counter-main-block'><div class='counter-timer' style='color:"+timerTxtColor+";'><span style='background-color:"+timerBgColor+";
318color:"+timerTxtColor+"'>" + parseInt(days/10) + "</span></div> <div class='counter-timer' style='color:"+timerTxtColor+";'><span style='background-color:"+timerBgColor+";color:"+timerTxtColor+"'>" + parseInt(days%10) + "</span></div><label>"+welcomebar_frontjs.days+"</label></div> : <div class='counter-main-block'><div class='counter-timer' style='color:"+timerTxtColor+";'> <span style='background-color:"+timerBgColor+";color:"+timerTxtColor+"'>" + parseInt(hours/10) + "</span></div> <div class='counter-timer' style='color:"+timerTxtColor+";'> <span style='background-color:"+timerBgColor+";color:"+timerTxtColor+"'>" + parseInt(hours%10) + "</span></div><label>"+welcomebar_frontjs.hours+"</label></div> : <div class='counter-main-block'><div class='counter-timer' style='color:"+timerTxtColor+";'><span style='background-color:"+timerBgColor+";color:"+timerTxtColor+"'>" + parseInt(minute/10) + "</span></div> <div class='counter-timer' style='color:"+timerTxtColor+";'><span style='background-color:"+timerBgColor+";color:"+timerTxtColor+"'>" + parseInt(minute%10) + "</span></div> <label>"+welcomebar_frontjs.minutes+"</label></div> : <div class='counter-main-block'><div class='counter-timer' style='color:"+timerTxtColor+";'><span style='background-color:"+timerBgColor+";color:"+timerTxtColor+"'>" + parseInt(seconds/10) + "</span></div> <div class='counter-timer' style='color:"+timerTxtColor+";'><span style='background-color:"+timerBgColor+";color:"+timerTxtColor+"'>" + parseInt(seconds%10) + "</span></div><label>"+welcomebar_frontjs.seconds+"</label></div>"); 319 } 320 321 }else{ 322 323 if (hours > 0) { 324 jQuery(divId).html( "<div class='counter-main-block'><div class='counter-timer' style='color:"+timerTxtColor+";'><span style='background-color:"+timerBgColor+";color:"+timerTxtColor+"'>" + parseInt(hours/10) + "</span></div> <div class='counter-timer' style='color:"+timerTxtColor+";'><span style='background-color:"+timerBgColor+";color:"+timerTxtColor+"'>" + parseInt(hours%10) + "</span></div> <label>"+welcomebar_frontjs.hours+"</label></div> : <div class='counter-main-block'><div class='counter-timer' style='color:"+timerTxtColor+";'><span style='background-color:"+timerBgColor+";color:"+timerTxtColor+"'>" + parseInt(minute/10) + "</span></div> <div class='counter-timer' style='color:"+timerTxtColor+";'><span style='background-color:"+timerBgColor+";color:"+timerTxtColor+"'>" + parseInt(minute%10) + "</span></div> <label>"+welcomebar_frontjs.minutes+"</label></div> : <div class='counter-main-block'><div class='counter-timer' style='color:"+timerTxtColor+";'><span style='background-color:"+timerBgColor+";color:"+timerTxtColor+"'>" + parseInt(seconds/10) + "</span></div> <div class='counter-timer' style='color:"+timerTxtColor+";'><span style='background-color:"+timerBgColor+";color:"+timerTxtColor+"'>" + parseInt(seconds%10) + "</span></div><label>"+welcomebar_frontjs.seconds+"</label></div>"); 325 }else{ 326 jQuery(divId).html( "<div class='counter-main-block'><div class='counter-timer' style='color:"+timerTxtColor+";'><span style='background-color:"+timerBgColor+";color:"+timerTxtColor+"'>" + parseInt(minute/10) + "</span></div> <div class='counter-timer' style='color:"+timerTxtColor+";'><span style='background-color:"+timerBgColor+";color:"+timerTxtColor+"'>" + parseInt(minute%10) + "</span></div> <label>"+welcomebar_frontjs.minutes+"</label></div> : <div class='counter-main-block'><div class='counter-timer' style='color:"+timerTxtColor+";'><span style='background-color:"+timerBgColor+";color:"+timerTxtColor+"'>" + parseInt(seconds/10) + "</span></div> <div class='counter-timer' style='color:"+timerTxtColor+";'><span style='background-color:"+timerBgColor+";color:"+timerTxtColor+"'>" + parseInt(seconds%10) + "</span></div><label>"+welcomebar_frontjs.seconds+"</label></div>"); 327 } 328 329 330 } 331 332 jQuery(divId + " span").css('color',timerTxtColor); 333 jQuery(divId).css('color',welcomebarTextColor); 334 335 } 336 },1000); 337 }); 338 339 /* end timer logic */ 340 341 } ); 342 343 function createMyStickyMenuCookie(name, value, days){ 344 if (days) { 345 var expiry = new Date(); 346 expiry.setTime(expiry.getTime()+(days*24*60*60*1000)); 347 var expires = "; expires=" + expiry.toGMTString(); 348 } else { 349 var expires = ""; 350 } 351 document.cookie = escape(name) + "=" + escape(value) + expires + "; path=/"; 352 } 353 354 function readMyStickyMenuCookie(name){ 355 var nameEQ = escape(name) + "="; 356 var ca = document.cookie.split(';'); 357 for (var i = 0; i < ca.length; i++) { 358 var c = ca[i];
359 while (c.charAt(0) == ' ') 360 c = c.substring(1, c.length); 361 if (c.indexOf(nameEQ) == 0) 362 return unescape(c.substring(nameEQ.length, c.length)); 363 } 364 return null; 365 } 366 367 function getCurrentDateTimeGMT(timezone){ 368 var localDate = new Date(); 369 var localTime = localDate.getTime(); 370 var localOffset = localDate.getTimezoneOffset() * 60000; 371 var utc = localTime + localOffset; 372 var offset = timezone; 373 var utc_offset = utc + (3600000 * offset); 374 localDate = new Date(utc_offset); 375 return localDate; 376 } 377 378 379 /* resize call to reset welcome bar */ 380 $( window ).resize( function(){ 381 jQuery( '.welcomebar-hidden-sliding-text' ).each( function(){ 382 var sliding_text_width = jQuery(this).outerWidth(); 383 var sliding_text_height = jQuery(this).outerHeight(); 384 //console.log( sliding_text_width + " =="+ sliding_text_height + " == "+ /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)); 385 if(!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) { 386 jQuery(this).parent().css('min-width', sliding_text_width + 'px'); 387 } 388 jQuery(this).parent().css('min-height', sliding_text_height + 'px'); 389 }); 390 391 var adminBarHeight = new_welcombar_height_top = new_welcombar_height_bottom = new_welcombar_margin_top = new_welcombar_padding_bottom = 0; 392 if ( $("#wpadminbar").length != 0 ){ 393 adminBarHeight = $('#wpadminbar').height(); 394 } 395 $( '.mysticky-welcomebar-fixed' ).each( function(){ 396 var welcomebar_widget = $( this ).data( 'welcomebar-widget' ); 397 var welcombar_aftersubmission = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).data('aftersubmission'); 398 399 if( welcombar_aftersubmission == 'dont_show_welcomebar' ){ 400 var welcomebar_storage = localStorage.getItem("welcomebar_close_" + welcomebar_widget); 401 } else if( welcombar_aftersubmission == 'show_welcomebar_next_visit' ) { 402 var welcomebar_storage = sessionStorage.getItem("welcomebar_close_" + welcomebar_widget); 403 } else { 404 sessionStorage.removeItem('welcomebar_close_' + welcomebar_widget); 405 localStorage.removeItem('welcomebar_close_' + welcomebar_widget); 406 var welcomebar_storage = null; 407 } 408 409 if ( welcomebar_storage === null ){ 410 var after_trigger = jQuery( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).data('after-triger'); 411 if ( after_trigger == 'after_a_few_seconds' ) { 412 var trigger_sec = jQuery( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).data('triger-sec') * 1000; 413 var welcombar_position = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).data('position'); 414 var welcombar_height = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).outerHeight(); 415 var divi_topbar_height = $( '.et_fixed_nav #top-header' ).outerHeight(); 416 var divi_total_height = welcombar_height + divi_topbar_height; 417 if ( $( window ).width() <= 1024 ) { 418 if ( $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).hasClass( 'mysticky-welcomebar-display-mobile' ) ) { 419 setTimeout(function(){ 420 jQuery( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).addClass( 'mysticky-welcomebar-animation' ); 421 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).addClass( 'entry-effect' ); 422 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).removeClass( 'mysticky-welcomebar-notpresent' ); 423 jQuery( '#mysticky_divi_style' ).remove(); 424 jQuery( '.et_fixed_nav #top-header' ).css( 'top', '' ); 425 if ( ! $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).hasClass( 'mysticky-welcomebar-notapper' ) ) { 426 jQuery( 'html,body' ).addClass( 'mysticky-welcomebar-apper' ); 427 } else { 428 jQuery( 'html,body' ).removeClass( 'mysticky-welcomebar-apper' ); 429 } 430 431 var new_welcombar_height_top = new_welcombar_height_bottom = new_welcombar_margin_top = new_welcombar_padding_bottom = 0; 432 /*set welcomebar position when welcombar display*/ 433 $( '.mysticky-welcomebar-fixed' ).not( ".mysticky-welcomebar-notpresent" ).each( function( index ){
434 var welcomebar_widget_ready = $( this ).data( 'welcomebar-widget' ); 435 var welcombar_position_ready = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget_ready ).data( 'position' ); 436 var welcombar_height_ready = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget_ready ).outerHeight(); 437 438 if( ! $( this ).hasClass( 'mysticky-welcomebar-notpresent' ) && ! $( this ).hasClass( 'mysticky-welcomebar-notapper' ) ) { 439 if ( welcombar_position_ready == 'top' ) { 440 if( index == 0 ){ 441 if ( $( window ).width() <= 600 ) { 442 if( $(window).scrollTop() > 0 ) { 443 var new_welcombar_position = 0 + new_welcombar_height_top; 444 } else { 445 var new_welcombar_position = adminBarHeight + 0 + new_welcombar_height_top; 446 } 447 } else { 448 var new_welcombar_position = adminBarHeight + 0 + new_welcombar_height_top; 449 } 450 451 var new_welcomebar_height = welcombar_height_ready + adminBarHeight + new_welcombar_margin_top; 452 new_welcombar_margin_top = new_welcombar_margin_top + adminBarHeight + $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget_ready ).outerHeight(); 453 454 } else { 455 var new_welcombar_position = 0 + new_welcombar_height_top; 456 var new_welcomebar_height = welcombar_height_ready + new_welcombar_margin_top; 457 new_welcombar_margin_top = new_welcombar_margin_top + $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget_ready ).outerHeight(); 458 } 459 460 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget_ready ).css( 'top', new_welcombar_position ); 461 jQuery( '.et_fixed_nav #top-header' ).css( 'top', new_welcombar_position + 'px' ); 462 new_welcombar_height_top = new_welcombar_position + $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget_ready ).outerHeight(); 463 464 465 $( 'html.mysticky-welcomebar-apper' ).attr( 'style', 'margin-top: ' + new_welcomebar_height + 'px !important' ); 466 $( '#mysticky-nav' ).css( 'top', new_welcomebar_height + 'px' ); 467 468 } else { 469 var new_welcombar_position = 0 + new_welcombar_height_bottom; 470 jQuery( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget_ready ).css( 'bottom', new_welcombar_position ); 471 new_welcombar_height_bottom = new_welcombar_position + $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget_ready ).outerHeight(); 472 473 var new_welcomebar_height = welcombar_height_ready + new_welcombar_padding_bottom; 474 jQuery( 'head' ).append( '<style class="mysticky_bottom_style" type="text/css">html.mysticky-welcomebar-apper {padding-bottom: ' + new_welcomebar_height + 'px}</style>' ); 475 new_welcombar_padding_bottom = new_welcombar_padding_bottom + $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget_ready ).outerHeight(); 476 } 477 } 478 } ); 479 480 if ( welcombar_position == 'top' ) { 481 jQuery( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).addClass( 'mysticky-welcomebar-animation' ); 482 483 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>' ); 484 485 jQuery( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).css( 'opacity', '1' ); 486 487 } else { 488 jQuery( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).css( 'opacity', '1' ); 489 jQuery( '.et_fixed_nav #top-header' ).css( 'top', '' ); 490 } 491 492 //mysticky_welcombar_automatically_close( welcomebar_widget ); 493 }, 0 ); // trigger_sec 494 } 495 } else { 496 if ( $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).hasClass( 'mysticky-welcomebar-display-desktop' ) ) { 497 setTimeout(function(){ 498 jQuery( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).addClass( 'mysticky-welcomebar-animation' ); 499 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).addClass( 'entry-effect' ); 500 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).removeClass( 'mysticky-welcomebar-notpresent' ); 501 if ( ! $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).hasClass( 'mysticky-welcomebar-notapper' ) ) { 502 jQuery( 'html,body' ).addClass( 'mysticky-welcomebar-apper' ); 503 } else { 504 jQuery( 'html,body' ).removeClass( 'mysticky-welcomebar-apper' ); 505 } 506 507 var new_welcombar_height_top = new_welcombar_height_bottom = new_welcombar_margin_top = new_welcombar_padding_bottom = 0; 508 /*set welcomebar position when welcombar display*/ 509 $( '.mysticky-welcomebar-fixed' ).not( ".mysticky-welcomebar-notpresent" ).each( function( index ){
510 var welcomebar_widget_ready = $( this ).data( 'welcomebar-widget' ); 511 var welcombar_position_ready = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget_ready ).data( 'position' ); 512 var welcombar_height_ready = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget_ready ).outerHeight(); 513 if( ! $( this ).hasClass( 'mysticky-welcomebar-notpresent' ) && ! $( this ).hasClass( 'mysticky-welcomebar-notapper' ) ) { 514 if ( welcombar_position_ready == 'top' ) { 515 516 if( index == 0 ){ 517 var new_welcombar_position = adminBarHeight + 0 + new_welcombar_height_top; 518 var new_welcomebar_height = welcombar_height_ready + adminBarHeight + new_welcombar_margin_top; 519 } else { 520 var new_welcombar_position = 0 + new_welcombar_height_top; 521 var new_welcomebar_height = welcombar_height_ready + new_welcombar_margin_top; 522 } 523 524 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget_ready ).css( 'top', new_welcombar_position ); 525 jQuery( '.et_fixed_nav #top-header' ).css( 'top', new_welcombar_position + 'px' ); 526 new_welcombar_height_top = new_welcombar_position + $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget_ready ).outerHeight(); 527 528 jQuery( '.mysticky-welcomebar-apper.et_fixed_nav #top-header' ).css( 'top', new_welcomebar_height + 'px' ); 529 jQuery( 'head' ).append( '<style id="mysticky_divi_style" type="text/css">.mysticky-welcomebar-apper.et_fixed_nav #main-header {top: ' + new_welcomebar_height + 'px !important}.mysticky-welcomebar-apper.et_fixed_nav #top-header + #main-header{top: ' + divi_total_height + 'px !important}</style>' ); 530 531 var new_welcomebar_height = adminBarHeight + welcombar_height_ready + new_welcombar_margin_top; 532 $( 'html.mysticky-welcomebar-apper' ).attr( 'style', 'margin-top: ' + new_welcomebar_height + 'px !important' ); 533 $( '#mysticky-nav' ).css( 'top', new_welcomebar_height + 'px' ); 534 new_welcombar_margin_top = new_welcombar_margin_top + $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget_ready ).outerHeight(); 535 } else { 536 var new_welcombar_position = 0 + new_welcombar_height_bottom; 537 jQuery( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget_ready ).css( 'bottom', new_welcombar_position ); 538 new_welcombar_height_bottom = new_welcombar_position + $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget_ready ).outerHeight(); 539 540 var new_welcomebar_height = welcombar_height_ready + new_welcombar_padding_bottom; 541 jQuery( 'head' ).append( '<style class="mysticky_bottom_style" type="text/css">html.mysticky-welcomebar-apper {padding-bottom: ' + new_welcomebar_height + 'px}</style>' ); 542 new_welcombar_padding_bottom = new_welcombar_padding_bottom + $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget_ready ).outerHeight(); 543 } 544 } 545 } ); 546 547 if ( welcombar_position == 'top' ) { 548 jQuery( '#mysticky_divi_style' ).remove(); 549 550 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>' ); 551 552 jQuery( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).css( 'opacity', '1' ); 553 554 } else { 555 jQuery( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).css( 'opacity', '1' ); 556 //$( 'html' ).css( 'margin-top', '' ); 557 jQuery( '#mysticky_divi_style' ).remove(); 558 jQuery( '.et_fixed_nav #top-header' ).css( 'top', '' ); 559 } 560 561 //mysticky_welcombar_automatically_close( welcomebar_widget ); 562 }, 0 ); // trigger_sec 563 } 564 } 565 } else { 566 if ( $( window ).width() <= 600 ) { 567 var new_welcombar_height_top = 0; 568 $( '.mysticky-welcomebar-fixed' ).not( ".mysticky-welcomebar-notpresent" ).each( function( index ){
569 var new_welcomebar_widget = $( this ).data( 'welcomebar-widget' ); 570 var test_welcombar_position = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + new_welcomebar_widget ).data('position'); 571 572 if( ! $( this ).hasClass( 'mysticky-welcomebar-notpresent' ) && ! $( this ).hasClass( 'mysticky-welcomebar-notapper' ) ) { 573 if ( test_welcombar_position == 'top' ) { 574 if( $(window).scrollTop() > 0 ) { 575 var new_welcombar_position = 0 + new_welcombar_height_top; 576 } else { 577 if( index == 0 ){ 578 var new_welcombar_position = 0 + adminBarHeight + new_welcombar_height_top; 579 }else{ 580 var new_welcombar_position = 0 + new_welcombar_height_top; 581 } 582 } 583 $( '.mysticky-welcomebar-apper .mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + new_welcomebar_widget ).css( 'top', new_welcombar_position ); 584 } 585 } 586 } ); 587 } 588 } 589 mystickyelements_present( welcomebar_widget ); 590 } 591 592 } ); 593 } ); 594 595 596 $( window ).on('scroll', function(){ 597 if ( $("#wpadminbar").length != 0 ){ 598 adminBarHeight = $('#wpadminbar').height(); 599 } 600 $( '.mysticky-welcomebar-fixed' ).each( function(){ 601 var welcomebar_widget = $( this ).data( 'welcomebar-widget' ); 602 var welcombar_aftersubmission = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).data('aftersubmission'); 603 var after_trigger = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).data('after-triger'); 604 if( welcombar_aftersubmission == 'dont_show_welcomebar' ){ 605 var welcomebar_storage = localStorage.getItem("welcomebar_close_" + welcomebar_widget); 606 } else if( welcombar_aftersubmission == 'show_welcomebar_next_visit' ) { 607 var welcomebar_storage = sessionStorage.getItem("welcomebar_close_" + welcomebar_widget); 608 } else { 609 sessionStorage.removeItem('welcomebar_close_' + welcomebar_widget); 610 localStorage.removeItem('welcomebar_close_' + welcomebar_widget); 611 var welcomebar_storage = null; 612 } 613 614 if ( welcomebar_storage === null ){ 615 var welcombar_height = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).outerHeight(); 616 var welcombar_position = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).data('position'); 617 var divi_topbar_height = $( '.et_fixed_nav #top-header' ).outerHeight(); 618 var divi_total_height = welcombar_height + divi_topbar_height; 619 620 if ( after_trigger === 'after_scroll' ) { 621 var scroll = 100 * $(window).scrollTop() / ($(document).height() - $(window).height()); 622 var after_scroll_val = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).data('triger-sec'); 623 624 if( scroll > after_scroll_val ) { 625 if ( ! $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).hasClass( 'mysticky-welcomebar-notapper' ) ) { 626 $( 'html,body' ).addClass( 'mysticky-welcomebar-apper' ); 627 } else { 628 $( 'html,body' ).removeClass( 'mysticky-welcomebar-apper' ); 629 } 630 if ( $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).hasClass( 'mysticky-welcomebar-display-desktop' ) ) { 631 if ( $( window ).width() > 1024 ) { 632 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).addClass( 'mysticky-welcomebar-animation' ); 633 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).addClass( 'entry-effect' ); 634 if( $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).hasClass( 'mysticky-welcomebar-notpresent' ) ) { 635 var new_welcombar_height_top = new_welcombar_height_bottom = new_welcombar_margin_top = new_welcombar_padding_bottom = 0; 636 637 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).removeClass( 'mysticky-welcomebar-notpresent' ); 638 639 /*set welcomebar position when welcombar display*/ 640 $( '.mysticky-welcomebar-fixed' ).not( ".mysticky-welcomebar-notpresent" ).each( function( index ){
641 var new_welcomebar_widget = $( this ).data( 'welcomebar-widget' ); 642 var test_welcombar_position = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + new_welcomebar_widget ).data('position'); 643 var welcombar_height_scroll = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + new_welcomebar_widget ).outerHeight(); 644 645 if( ! $( this ).hasClass( 'mysticky-welcomebar-notpresent' ) && ! $( this ).hasClass( 'mysticky-welcomebar-notapper' ) ) { 646 if ( test_welcombar_position == 'top' ) { 647 648 new_welcombar_margin_top = new_welcombar_margin_top + adminBarHeight + $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + new_welcomebar_widget ).outerHeight(); 649 if( $(window).scrollTop() == 0 ) { 650 var new_welcombar_position = 0 + new_welcombar_height_top; 651 } else { 652 if( index != 0 ){ 653 var new_welcombar_position = 0 + new_welcombar_height_top; 654 } else { 655 var new_welcombar_position = adminBarHeight + 0 + new_welcombar_height_top; 656 } 657 } 658 659 $( '.mysticky-welcomebar-apper .mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + new_welcomebar_widget ).css( 'top', new_welcombar_position ); 660 new_welcombar_height_top = new_welcombar_position + $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + new_welcomebar_widget ).outerHeight(); 661 662 var new_welcomebar_height = new_welcombar_margin_top; 663 jQuery( '.mysticky-welcomebar-apper.et_fixed_nav #top-header' ).css( 'top', new_welcomebar_height + 'px' ); 664 jQuery( 'head' ).append( '<style id="mysticky_divi_style" type="text/css">.mysticky-welcomebar-apper.et_fixed_nav #main-header {top: ' + new_welcomebar_height + 'px !important}.mysticky-welcomebar-apper.et_fixed_nav #top-header + #main-header{top: ' + divi_total_height + 'px !important}</style>' ); 665 $( 'html.mysticky-welcomebar-apper' ).attr( 'style', 'margin-top: ' + new_welcomebar_height + 'px !important' ); 666 $( '.mysticky-welcomebar-apper #mysticky-nav' ).css( 'top', new_welcomebar_height + 'px' ); 667 new_welcombar_margin_top = new_welcombar_margin_top + $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + new_welcomebar_widget ).outerHeight(); 668 } else { 669 var new_welcombar_position = 0 + new_welcombar_height_bottom; 670 $( '.mysticky-welcomebar-apper .mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + new_welcomebar_widget ).css( 'bottom', new_welcombar_position ); 671 new_welcombar_height_bottom = new_welcombar_position + $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + new_welcomebar_widget ).outerHeight(); 672 var new_welcomebar_height = welcombar_height_scroll + new_welcombar_padding_bottom; 673 $( 'head' ).append( '<style class="mysticky_bottom_style" type="text/css">html.mysticky-welcomebar-apper {padding-bottom: ' + new_welcomebar_height + 'px}</style>' ); 674 new_welcombar_padding_bottom = new_welcombar_padding_bottom + $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + new_welcomebar_widget ).outerHeight(); 675 } 676 } 677 } ); 678 } 679 680 if ( welcombar_position == 'top' ) { 681 $( '.mysticky-welcomebar-apper .mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).css( 'opacity', '1' ); 682 jQuery( '#mysticky_divi_style' ).remove(); 683 } else { 684 jQuery( '.mysticky-welcomebar-apper .mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).css( 'opacity', '1' ); 685 jQuery( '#mysticky_divi_style' ).remove(); 686 jQuery( '.et_fixed_nav #top-header' ).css( 'top', '' ); 687 } 688 } 689 } 690 if ( $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).hasClass( 'mysticky-welcomebar-display-mobile' ) ) { 691 if ( $( window ).width() <= 1024 ) { 692 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).addClass( 'mysticky-welcomebar-animation' ); 693 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).addClass( 'entry-effect' ); 694 $( '#mysticky_divi_style' ).remove();
695 $( '.et_fixed_nav #top-header' ).css( 'top', '' ); 696 697 if( $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).hasClass( 'mysticky-welcomebar-notpresent' ) ) { 698 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).removeClass( 'mysticky-welcomebar-notpresent' ); 699 var new_welcombar_height_top = new_welcombar_height_bottom = new_welcombar_margin_top = new_welcombar_padding_bottom = 0; 700 $( '.mysticky-welcomebar-fixed' ).not( ".mysticky-welcomebar-notpresent" ).each( function(){ 701 var new_welcomebar_widget = $( this ).data( 'welcomebar-widget' ); 702 var test_welcombar_position = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + new_welcomebar_widget ).data('position'); 703 var welcombar_height_scroll = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + new_welcomebar_widget ).outerHeight(); 704 705 if( ! $( this ).hasClass( 'mysticky-welcomebar-notpresent' ) && ! $( this ).hasClass( 'mysticky-welcomebar-notapper' ) ) { 706 if ( test_welcombar_position == 'top' ) { 707 if( new_welcomebar_widget == 0 ){ 708 if ( $( window ).width() <= 600 ) { 709 var new_welcombar_position = 0 + new_welcombar_height_top; 710 } else { 711 var new_welcombar_position = 0 + new_welcombar_height_top + adminBarHeight; 712 } 713 new_welcombar_height_top = new_welcombar_position + $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + new_welcomebar_widget ).outerHeight(); 714 var new_welcomebar_height = welcombar_height_scroll + new_welcombar_margin_top + adminBarHeight; 715 }else{ 716 var new_welcombar_position = 0 + new_welcombar_height_top; 717 new_welcombar_height_top = new_welcombar_position + $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + new_welcomebar_widget ).outerHeight(); 718 var new_welcomebar_height = welcombar_height_scroll + new_welcombar_margin_top; 719 } 720 $( '.mysticky-welcomebar-apper .mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + new_welcomebar_widget ).css( 'top', new_welcombar_position ); 721 722 jQuery( '.mysticky-welcomebar-apper.et_fixed_nav #top-header' ).css( 'top', new_welcomebar_height + 'px' ); 723 jQuery( 'head' ).append( '<style id="mysticky_divi_style" type="text/css">.mysticky-welcomebar-apper.et_fixed_nav #main-header {top: ' + new_welcomebar_height + 'px !important}.mysticky-welcomebar-apper.et_fixed_nav #top-header + #main-header{top: ' + divi_total_height + 'px !important}</style>' ); 724 725 $( 'html.mysticky-welcomebar-apper' ).attr( 'style', 'margin-top: ' + new_welcomebar_height + 'px !important' ); 726 $( '.mysticky-welcomebar-apper #mysticky-nav' ).css( 'top', new_welcomebar_height + 'px' ); 727 new_welcombar_margin_top = new_welcombar_margin_top + $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + new_welcomebar_widget ).outerHeight(); 728 } else { 729 var new_welcombar_position = 0 + new_welcombar_height_bottom; 730 $( '.mysticky-welcomebar-apper .mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + new_welcomebar_widget ).css( 'bottom', new_welcombar_position ); 731 new_welcombar_height_bottom = new_welcombar_position + $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + new_welcomebar_widget ).outerHeight(); 732 var new_welcomebar_height = welcombar_height_scroll + new_welcombar_padding_bottom; 733 jQuery( 'head' ).append( '<style class="mysticky_bottom_style" type="text/css">html.mysticky-welcomebar-apper {padding-bottom: ' + new_welcomebar_height + 'px}</style>' ); 734 new_welcombar_padding_bottom = new_welcombar_padding_bottom + $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + new_welcomebar_widget ).outerHeight(); 735 } 736 } 737 } ); 738 } 739 if ( welcombar_position == 'top' ) { 740 jQuery( '.mysticky-welcomebar-apper .mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).css( 'opacity', '1' ); 741 } else { 742 jQuery( '.mysticky-welcomebar-apper .mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).css( 'opacity', '1' ); 743 } 744 } 745 } 746 //mysticky_welcombar_automatically_close( welcomebar_widget ); 747 } else if( $(window).scrollTop() == 0 ) { 748 if ( $( window ).width() <= 600 ) { 749 if ( $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).hasClass( 'mysticky-welcomebar-display-mobile' ) ) { 750 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).addClass( 'mysticky-welcomebar-notpresent' ); 751 var new_welcombar_height_top = 0; 752 $( '.mysticky-welcomebar-fixed' ).each( function( index ){
753 var new_welcomebar_widget = $( this ).data( 'welcomebar-widget' ); 754 var test_welcombar_position = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + new_welcomebar_widget ).data('position'); 755 756 if ( test_welcombar_position == 'top' ) { 757 if( index == 0 ){ 758 var new_welcombar_position = 0 + adminBarHeight + new_welcombar_height_top; 759 }else{ 760 var new_welcombar_position = 0 + new_welcombar_height_top; 761 } 762 $( '.mysticky-welcomebar-apper .mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + new_welcomebar_widget ).css( 'top', new_welcombar_position ); 763 new_welcombar_height_top = new_welcombar_position + $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + new_welcomebar_widget ).outerHeight(); 764 } 765 766 } ); 767 } 768 } 769 } 770 } else { 771 if ( $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).hasClass( 'mysticky-welcomebar-display-mobile' ) ) { 772 if ( $( window ).width() <= 600 ) { 773 var new_welcombar_height_top = 0; 774 $( '.mysticky-welcomebar-fixed' ).not( ".mysticky-welcomebar-notpresent" ).each( function( index ){ 775 var new_welcomebar_widget = $( this ).data( 'welcomebar-widget' ); 776 var test_welcombar_position = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + new_welcomebar_widget ).data('position'); 777 778 if( ! $( this ).hasClass( 'mysticky-welcomebar-notpresent' ) && ! $( this ).hasClass( 'mysticky-welcomebar-notapper' ) ) { 779 if ( test_welcombar_position == 'top' ) { 780 if( $(window).scrollTop() > 0 ) { 781 var new_welcombar_position = 0 + new_welcombar_height_top; 782 } else { 783 if( index == 0 ){ 784 var new_welcombar_position = 0 + adminBarHeight + new_welcombar_height_top; 785 }else{ 786 var new_welcombar_position = 0 + new_welcombar_height_top; 787 } 788 } 789 $( '.mysticky-welcomebar-apper .mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + new_welcomebar_widget ).css( 'top', new_welcombar_position ); 790 new_welcombar_height_top = new_welcombar_position + $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + new_welcomebar_widget ).outerHeight(); 791 } 792 } 793 } ); 794 } 795 } 796 } 797 mystickyelements_present( welcomebar_widget ); 798 } 799 } ); 800 }); 801 802 /* Mysticky Menu : welcombar got it button & close click function */ 803 804 $( '.mysticky-welcomebar-close, .mysticky-welcomebar-btn a' ).on( 'click', function(e){ 805 if ($(this).attr('href') == '') { 806 e.preventDefault(); 807 } 808 809 var new_welcombar_margin_top_close = new_welcombar_height_top_close = 0; 810 var new_welcombar_padding_bottom_close = new_welcombar_height_bottom_close = 0; 811 var welcomebar_widget = $( this ).data( 'welcomebar-widget' ); 812 var welcombar_rediect = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).data('rediect'); 813 var welcombar_height = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).outerHeight(); 814 var welcombar_aftersubmission = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).data('aftersubmission'); 815 var welcombar_position = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).data('position'); 816 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).addClass( 'mysticky-welcomebar-notapper' ); 817 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).addClass( 'mysticky-welcomebar-notpresent' ); 818 819 if( $( '.mysticky-welcomebar-notapper' ).length == $( '.mysticky-welcomebar-fixed' ).length ) { 820 $( 'html,body' ).removeClass( 'mysticky-welcomebar-apper' ); 821 } 822 823 /** 824 * Submit contact lead form 825 */ 826 827 if( jQuery(".mysticky-welcomebar-widget-"+welcomebar_widget+" .mysticky-welcomebar-lead-content").length > 0 && !$(this).hasClass("mysticky-welcomebar-close")){ 828 829 var flag=true; 830 831 if( jQuery('#contact-lead-name-'+welcomebar_widget).val() != '' && ( jQuery('#contact-lead-phone-'+welcomebar_widget).val() != '' || jQuery('#contact-lead-email-'+welcomebar_widget).val() != '' )){ 832 833 if( jQuery('#contact-lead-email-'+welcomebar_widget).css("display") != 'none' && IsEmail(jQuery('#contact-lead-email-'+welcomebar_widget).val()) != true ){ 834 835 if( $(".mysticky-welcomebar-widget-"+welcomebar_widget+" .input-error").length ){ 836 $(".mysticky-welcomebar-widget-"+welcomebar_widget+" .input-error").remove(); 837 } 838 839 $( '<div class="input-error"><span>Please, enter valid email</span></div>' ).insertAfter( jQuery('#contact-lead-email-'+welcomebar_widget) ); 840 flag = false; 841 } 842 843 844 if( jQuery('#contact-lead-phone-'+welcomebar_widget).css("display") != 'none' && validatePhone(jQuery('#contact-lead-phone-'+welcomebar_widget).val()) != true ){ 845 if( $(".mysticky-welcomebar-widget-"+welcomebar_widget+" .input-error").length ){ 846 $(".mysticky-welcomebar-widget-"+welcomebar_widget+" .input-error").remove(); 847 } 848 849 $( '<div class="input-error"><span>Please, enter valid phone</span></div>' ).insertAfter( jQuery('#contact-lead-phone-'+welcomebar_widget) ); 850 flag=false; 851 } 852 853 if (flag == true) { 854 855 var data = []; 856 data["contact_name"] = jQuery('#contact-lead-name-'+welcomebar_widget).val(); 857 data["contact_email"] = jQuery('#contact-lead-email-'+welcomebar_widget).val(); 858 data["contact_phone"] = jQuery('#contact-lead-phone-'+welcomebar_widget).val(); 859 data["contact_page_link"] = jQuery('#contact-lead-pagelink-'+welcomebar_widget).val(); 860 861 if( welcombar_rediect == 'thankyou_screen' ){ 862 $(".mysticky-welcomebar-widget-"+welcomebar_widget+" .mysticky-welcomebar-lead-content").hide(); 863 $(".mysticky-welcomebar-widget-"+welcomebar_widget+" .mysticky-welcomebar-content p").hide(); 864 $(".mysticky-welcomebar-widget-"+welcomebar_widget+" .mysticky-welcomebar-content .mysticky-welcomebar-thankyou-content p").show(); 865 } 866 jQuery.ajax({ 867 url: welcomebar_frontjs.ajaxurl, 868 type:'post', 869 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, 870 success: function( data ){ 871 $(".mysticky-welcomebar-widget-"+welcomebar_widget+" .mysticky-welcomebar-fixed-wrap").css("margin-bottom","0"); 872 }, 873 });
874 875 }else{ 876 $(".mysticky-welcomebar-widget-"+welcomebar_widget+" .mysticky-welcomebar-fixed-wrap").css("margin-bottom","10px"); 877 return false; 878 } 879 880 }else{ 881 882 localStorage.removeItem('welcomebar_close_' + welcomebar_widget); 883 sessionStorage.removeItem('welcomebar_close_' + welcomebar_widget); 884 885 if($(".mysticky-welcomebar-widget-"+welcomebar_widget+" .input-error").length){ 886 $(".mysticky-welcomebar-widget-"+welcomebar_widget+" .input-error").remove(); 887 } 888 889 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() == '' ){ 890 891 $( '<div class="input-error"><span>Please enter your name and email</span></div>' ).insertAfter( jQuery('#contact-lead-name-'+welcomebar_widget) ); 892 flag=false; 893 894 }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() == '' ){ 895 896 $( '<div class="input-error"><span>Please enter your name and phone</span></div>' ).insertAfter( jQuery('#contact-lead-name-'+welcomebar_widget) ); 897 flag=false; 898 899 }else if( jQuery('#contact-lead-name-'+welcomebar_widget).css("display") != 'none' && jQuery('#contact-lead-name-'+welcomebar_widget).val() == '' ){ 900 901 $( '<div class="input-error"><span>Please enter your name</span></div>' ).insertAfter( jQuery('#contact-lead-name-'+welcomebar_widget) ); 902 flag=false; 903 904 }else if( jQuery('#contact-lead-email-'+welcomebar_widget).css("display") != 'none' && jQuery('#contact-lead-email-'+welcomebar_widget).val() == '' ){ 905 906 $( '<div class="input-error"><span>Please, enter your email</span></div>' ).insertAfter( jQuery('#contact-lead-email-'+welcomebar_widget) ); 907 flag=false; 908 909 }else if( jQuery('#contact-lead-phone-'+welcomebar_widget).css("display") != 'none' && jQuery('#contact-lead-phone-'+welcomebar_widget).val() == '' ){ 910 911 $( '<div class="input-error"><span>Please, enter your phone</span></div>' ).insertAfter( jQuery('#contact-lead-phone-'+welcomebar_widget) ); 912 flag=false; 913 914 } 915 916 if(flag==false){ 917 $(".mysticky-welcomebar-widget-"+welcomebar_widget+" .mysticky-welcomebar-fixed-wrap").css("margin-bottom","10px"); 918 } else{ 919 $(".mysticky-welcomebar-widget-"+welcomebar_widget+" .mysticky-welcomebar-fixed-wrap").css("margin-bottom","0"); 920 } 921 return false; 922 } 923 }else{ 924 if( $(this).hasClass("mysticky-welcomebar-close") ){ 925 localStorage.setItem('is_close_trigger_' + welcomebar_widget, 'yes'); 926 } 927 } 928 929 if( welcombar_rediect != 'thankyou_screen' || $( this ).attr( 'class' ) == 'mysticky-welcomebar-close' ) { 930 if( welcombar_aftersubmission != 'show_welcomebar_every_page' ){ 931 if( welcombar_aftersubmission == 'dont_show_welcomebar' ){ 932 sessionStorage.removeItem('welcomebar_close_' + welcomebar_widget); 933 localStorage.setItem('welcomebar_close_' + welcomebar_widget, 'close'); 934 } else if( welcombar_aftersubmission == 'show_welcomebar_next_visit' ) { 935 localStorage.removeItem('welcomebar_close_' + welcomebar_widget); 936 sessionStorage.setItem('welcomebar_close_' + welcomebar_widget, 'close'); 937 } 938 } 939 940 941 if( jQuery(this).data("isenable-coupon") == 1 ){ 942 jQuery(".mysticky-welcomebar-widget-"+welcomebar_widget).find(".mysticky-welcomebar-btn").hide(); 943 jQuery(".mysticky-welcomebar-widget-"+welcomebar_widget).find(".mysticky-welcomebar-content").hide(); 944 jQuery(".mysticky-welcomebar-widget-"+welcomebar_widget).find(".mysticky-couponbar-content").show(); 945 946 947 $(".mysticky-welcomebar-widget-"+welcomebar_widget + " .count-down-timer-box").hide(); 948 949 if( jQuery(".mysticky-welcomebar-fixed.mysticky-welcomebar-widget-"+welcomebar_widget+" .mysticky-welcomebar-lead-content").length > 0 ){ 950 951 jQuery(".mysticky-welcomebar-fixed.mysticky-welcomebar-widget-"+welcomebar_widget+" .mysticky-welcomebar-lead-content").hide(); 952 } 953 localStorage.setItem('is_button_trigger_' + welcomebar_widget, 'yes'); 954 return; 955 } 956 957 var is_autometically_close_after_click = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).data("automatically-enabled"); 958 var after_click_close_sec = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).data("automatically-triggersec"); 959 960 console.log(is_autometically_close_after_click + " == "+ after_click_close_sec); 961 /* click after autometically close welcomebar and normal close */ 962 if (is_autometically_close_after_click == '' ) { 963 after_click_close_sec = 0; 964 } 965 966 setTimeout(function(){ 967 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).slide
967Up( 'slow' ); 968 if ( welcombar_position == 'top' ) { 969 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).css( 'top', '-' + welcombar_height + 'px' ); 970 } else { 971 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).css( 'bottom', '-' + welcombar_height + 'px' ); 972 $('.mysticky_bottom_style').remove(); 973 } 974 975 var welcomebar__height = parseFloat($( '.mysticky-welcomebar-fixed.mysticky-welcomebar-position-top.mysticky-welcomebar-widget-' + welcomebar_widget ).outerHeight()); 976 var html_margin_top = jQuery("html").css("margin-top"); 977 html_margin_top = html_margin_top.replace("px",''); 978 jQuery("html").css("margin-top", (parseInt(html_margin_top) - welcomebar__height) + "px"); 979 if ( $( '#mysticky-nav' ).length > 0) { 980 $( '#mysticky-nav' ).css( 'top', (parseInt(html_margin_top) - welcomebar__height) + "px"); 981 } 982 983 jQuery( '#mysticky_divi_style' ).remove(); 984 jQuery( '.et_fixed_nav #top-header' ).css( 'top', '' ); 985 jQuery( 'html' ).css( 'padding-bottom', '' ); 986 987 /*if mystickyelements show*/ 988 var mystickyelements_show = $( '.mystickyelements-fixed' ).length; 989 if( mystickyelements_show && $( window ).width() <= 1024 && $( '.mystickyelements-fixed' ).hasClass( 'mystickyelements-position-mobile-top' ) && welcombar_position == 'top' ) { 990 var mystickyelements_height = adminBarHeight + $( '.mystickyelements-fixed' ).height(); 991 $( '.mystickyelements-fixed' ).css( 'top', '' ); 992 $( 'html' ).attr( 'style', 'margin-top: ' + mystickyelements_height + 'px !important' ); 993 } 994 995 jQuery(window).trigger('resize'); 996 997 },(parseInt(after_click_close_sec) * 1000)); 998 999 1000 1001 } else { 1002 1003 var welcomebarHeight = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-'+ welcomebar_widget ).css("height"); 1004 if( $(".mysticky-welcomebar-fixed.mysticky-welcomebar-widget-"+ welcomebar_widget+" .count-down-timer-box").length > 0 && $(".count-down-timer-box").css("display") != 'none' ){ 1005 jQuery(".count-down-timer-box").hide(); 1006 } 1007 $(".mysticky-welcomebar-fixed.mysticky-welcomebar-widget-"+ welcomebar_widget + " .mysticky-welcomebar-content p").first().hide(); 1008 1009 if( jQuery(".mysticky-welcomebar-widget-"+welcomebar_widget+" .mysticky-welcomebar-lead-content").length <= 0 && !$( this ).hasClass('mysticky-welcomebar-close')){ 1010 1011 var thankyou_content_height = jQuery('.mysticky-welcomebar-thankyou-content').height(); 1012 if( thankyou_content_height > 60 ) { 1013 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).css({ 'min-height': thankyou_content_height + 'px', 'height' : 'auto' }); 1014 } 1015 1016 $( '.mysticky-welcomebar-widget-'+ welcomebar_widget +' .mysticky-welcomebar-thankyou-content' ).show(); 1017 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget- .mysticky-welcomebar-content > p' ).hide(); 1018 $( '.mysticky-welcomebar-widget-'+ welcomebar_widget +' .mysticky-welcomebar-btn' ).hide(); 1019 }else if( jQuery(".mysticky-welcomebar-widget-"+welcomebar_widget+" .mysticky-welcomebar-lead-content").length && $(this).parent().hasClass("mysticky-welcomebar-btn")){ 1020 1021 var thankyou_content_height = jQuery('.mysticky-welcomebar-thankyou-content').height(); 1022 if( thankyou_content_height > 60 ) { 1023 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).css({ 'min-height': thankyou_content_height + 'px', 'height' : 'auto' }); 1024 } 1025 1026 $( '.mysticky-welcomebar-widget-'+ welcomebar_widget +' .mysticky-welcomebar-thankyou-content' ).show(); 1027 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget- .mysticky-welcomebar-content > p' ).hide(); 1028 $( '.mysticky-welcomebar-widget-'+ welcomebar_widget +' .mysticky-welcomebar-btn' ).hide(); 1029 }else{ 1030 1031 1032 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).slideUp( 'slow' ); 1033 if ( welcombar_position == 'top' ) { 1034 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).css( 'to
1034p', '-' + welcombar_height + 'px' ); 1035 } else { 1036 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).css( 'bottom', '-' + welcombar_height + 'px' ); 1037 $('.mysticky_bottom_style').remove(); 1038 } 1039 /* 1040 var welcomebar__height = parseInt($( '.mysticky-welcomebar-fixed.mysticky-welcomebar-position-top.mysticky-welcomebar-widget-' + welcomebar_widget ).outerHeight()); 1041 var html_margin_top = jQuery("html").css("margin-top"); 1042 html_margin_top = html_margin_top.replace("px",''); 1043 jQuery("html").css("margin-top",""+(parseInt(html_margin_top) - welcomebar__height)+"px") 1044 */ 1045 } 1046 1047 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-'+ welcomebar_widget ).css("height",welcomebarHeight); 1048 1049 if ( welcombar_position === 'top') { 1050 setTimeout(hideBarAnimation, 1000,welcomebar_widget,welcombar_position,welcombar_height); 1051 } 1052 localStorage.setItem('welcomebar_close_' + welcomebar_widget, 'close'); 1053 jQuery(window).trigger('resize'); 1054 1055 } 1056 1057 } ); 1058 1059/** 1060 * DATE : 2022-07-01 1061 * Hide or Close Welcombar Bar Animation After 3 Second. for show and read thank you message. 1062 */ 1063 function hideBarAnimation(welcomebar_widget,welcombar_position,welcombar_height){ 1064 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).slideUp( 'slow' ); 1065 if ( welcombar_position == 'top' ) { 1066 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).css( 'top', '-' + welcombar_height + 'px' ); 1067 } else { 1068 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).css( 'bottom', '-' + welcombar_height + 'px' ); 1069 } 1070 1071 var html_margin_top = jQuery("html").css("margin-top"); 1072 html_margin_top = html_margin_top.replace("px",''); 1073 1074 jQuery("html").css("margin-top", (parseInt(html_margin_top) - parseInt(welcombar_height)) + "px") 1075 if ( $( '#mysticky-nav' ).length > 0) { 1076 $( '#mysticky-nav' ).css( 'top', (parseInt(html_margin_top) - parseInt(welcombar_height)) + "px") 1077 } 1078 jQuery(window).trigger('resize'); 1079 } 1080 1081 $('.coupon-cpy-tooltip').on("click",function(){ 1082 var idd = $(this).attr('id'); 1083 $('#'+idd + ' .tooltiptext').css({"visibility":"visible","opacity":"1"}); 1084 setTimeout(function(){$('#'+idd +' .tooltiptext').css({"visibility":"hidden","opacity":"0"});}, 3000); 1085 1086 var copyText = $("#"+idd+" a"); 1087 copyText.select(); 1088 navigator.clipboard.writeText(copyText.text().trim()); 1089 }); 1090 1091 1092 /*function*/ 1093 function mystickyelements_present( welcomebar_widget ) { 1094 var after_trigger = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).data('after-triger'); 1095 var mystickyelements_show = $( '.mystickyelements-fixed' ).length; 1096 var welcombar_position = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).data('position'); 1097 1098 if( mystickyelements_show ) { 1099 var welcombar_position = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).data('position'); 1100 var welcombar_height = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).outerHeight(); 1101 var mystickyelements_height = $( '.mystickyelements-fixed' ).height(); 1102 var mystickyelements_total_height = adminBarHeight + welcombar_height + mystickyelements_height; 1103 if ( $( window ).width() <= 1024 && $( '.mystickyelements-fixed' ).hasClass( 'mystickyelements-position-mobile-top' ) ) { 1104 if ( after_trigger == 'after_a_few_seconds' ) { 1105 if ( $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).hasClass( 'mysticky-welcomebar-display-mobile' ) ) { 1106 var trigger_sec = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).data('triger-sec') * 1000; 1107 setTimeout(function(){ 1108 if ( welcombar_position == 'top' ) { 1109 if ( jQuery( window ).width() <= 600 && jQuery(window).scrollTop() != 0 && welcombar_position == 'top') { 1110 welcombar_height = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).outerHeight() - adminBarHeight; 1111 mystickyelements_total_height = ( welcombar_height + mystickyelements_he
1111ight ) - adminBarHeight; 1112 $( '.mystickyelements-fixed' ).css( 'top', welcombar_height ); 1113 $( 'html' ).attr( 'style', 'margin-top: ' + mystickyelements_total_height + 'px !important' ); 1114 } else { 1115 $( '.mystickyelements-fixed' ).css( 'top', welcombar_height ); 1116 $( 'html' ).attr( 'style', 'margin-top: ' + mystickyelements_total_height + 'px !important' ); 1117 } 1118 } else { 1119 $( '.mystickyelements-fixed' ).css( 'top', '' ); 1120 if( ! jQuery( 'style' ).hasClass( 'mysticky_bottom_style' ) ) { 1121 jQuery( 'head' ).append( '<style class="mysticky_bottom_style" type="text/css">html.mysticky-welcomebar-apper {padding-bottom: ' + welcombar_height + 'px}</style>' ); 1122 } 1123 } 1124 }, trigger_sec ); 1125 } 1126 } else if ( after_trigger === 'after_scroll' ) { 1127 var scroll = 100 * $(window).scrollTop() / ($(document).height() - $(window).height()); 1128 var after_scroll_val = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).data('triger-sec'); 1129 if( scroll > after_scroll_val ) { 1130 if ( $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).hasClass( 'mysticky-welcomebar-display-mobile' ) ) { 1131 if ( welcombar_position == 'top' ) { 1132 $( '.mystickyelements-fixed' ).css( 'top', welcombar_height ); 1133 $( 'html' ).attr( 'style', 'margin-top: ' + mystickyelements_total_height + 'px !important' ); 1134 } else { 1135 $( '.mystickyelements-fixed' ).css( 'top', '' ); 1136 if( ! $( 'style' ).hasClass( 'mysticky_bottom_style' ) ) { 1137 $( 'head' ).append( '<style class="mysticky_bottom_style" type="text/css">html.mysticky-welcomebar-apper {padding-bottom: ' + welcombar_height + 'px}</style>' ); 1138 } 1139 } 1140 } 1141 } 1142 } 1143 } 1144 } 1145 } 1146 1147 function mysticky_welcombar_automatically_close( welcomebar_widget ) { 1148 var welcombar_automatically_enabled = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).data( 'automatically-enabled' ); 1149 var automatically_triggersec = jQuery( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).data('automatically-triggersec') * 1000; 1150 var welcombar_aftersubmission = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).data('aftersubmission'); 1151 var welcombar_height = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).outerHeight(); 1152 if( welcombar_automatically_enabled == 1 ) { 1153 1154 setTimeout(function(){ 1155 jQuery( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).addClass( 'mysticky-welcomebar-notapper' ); 1156 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).addClass( 'mysticky-welcomebar-notpresent' ); 1157 if( jQuery( '.mysticky-welcomebar-notapper' ).length == jQuery( '.mysticky-welcomebar-fixed' ).length ) { 1158 jQuery( 'html,body' ).removeClass( 'mysticky-welcomebar-apper' ); 1159 } 1160 if( welcombar_aftersubmission != 'show_welcomebar_every_page' ){ 1161 if( welcombar_aftersubmission == 'dont_show_welcomebar' ){ 1162 sessionStorage.removeItem('welcomebar_close_' + welcomebar_widget); 1163 localStorage.setItem('welcomebar_close_' + welcomebar_widget, 'close'); 1164 } else if( welcombar_aftersubmission == 'show_welcomebar_next_visit' ) { 1165 localStorage.removeItem('welcomebar_close_' + welcomebar_widget); 1166 sessionStorage.setItem('welcomebar_close_' + welcomebar_widget, 'close'); 1167 } 1168 } 1169 var welcombar_position = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).data('position'); 1170 1171 jQuery( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).slideUp( 'slow' ); 1172 if ( welcombar_position == 'top' ) { 1173 jQuery( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).css( 'top', '-' + welcombar_height + 'px' ); 1174 } else { 1175 jQuery( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + welcomebar_widget ).css( 'bottom', '-' + welcombar_height + 'px' ); 1176 } 1177 var new_welcombar_margin_top_close = new_welcombar_height_top_close = 0; 1178 var new_welcombar_padding_bottom_close = new_welcombar_height_bottom_close = 0; 1179 /*set welcomebar position when other welcombar close*/ 1180 $( '.mysticky-welcomebar-fixed' ).each( function(){ 1181 var common_welcombar_position = $( this ).data( 'position' );
1182 var common_welcomebar_widget = $( this ).data( 'welcomebar-widget' ); 1183 if ( common_welcombar_position == 'top' ) { 1184 if( ! $( this ).hasClass( 'mysticky-welcomebar-notapper' ) && ! $( this ).hasClass( 'mysticky-welcomebar-notpresent' ) ) { 1185 var common_welcombar_height = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + common_welcomebar_widget ).outerHeight(); 1186 var new_welcomebar_height = common_welcombar_height + new_welcombar_margin_top_close; 1187 var new_welcombar_position = 0 + new_welcombar_height_top_close; 1188 1189 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + common_welcomebar_widget ).css( 'top', new_welcombar_position ); 1190 new_welcombar_height_top_close = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + common_welcomebar_widget ).outerHeight() - new_welcombar_position; 1191 1192 $( 'html.mysticky-welcomebar-apper' ).attr( 'style', 'margin-top: ' + new_welcomebar_height + 'px !important' ); 1193 1194 $( '#mysticky-nav' ).css( 'top', new_welcomebar_height + 'px' ); 1195 new_welcombar_margin_top_close = new_welcombar_margin_top_close + $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + common_welcomebar_widget ).outerHeight(); 1196 } else { 1197 var welcomebar_fixed_length = $( '.mysticky-welcomebar-fixed' ).length; 1198 var welcomebar_notapper_length = $( '.mysticky-welcomebar-notapper' ).length; 1199 var welcomebar_notapper_top_length = $( '.mysticky-welcomebar-position-top.mysticky-welcomebar-notapper' ).length; 1200 var welcomebar_notpresent_top_length = $( '.mysticky-welcomebar-position-top.mysticky-welcomebar-notpresent' ).length; 1201 var welcomebar_top_length = $( '.mysticky-welcomebar-position-top' ).length; 1202 if( welcomebar_notapper_length == welcomebar_fixed_length || welcomebar_top_length == welcomebar_notapper_top_length || welcomebar_top_length == welcomebar_notpresent_top_length ) { 1203 $( 'html' ).css( 'margin-top', '' ); 1204 $( '#mysticky-nav' ).css( 'top', '0px' ); 1205 } 1206 } 1207 } else { 1208 if( ! $( this ).hasClass( 'mysticky-welcomebar-notapper' ) && ! $( this ).hasClass( 'mysticky-welcomebar-notpresent' ) ) { 1209 var common_welcombar_height = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + common_welcomebar_widget ).outerHeight(); 1210 var new_welcomebar_height = common_welcombar_height + new_welcombar_padding_bottom_close; 1211 var new_welcombar_position = 0 + new_welcombar_height_bottom_close; 1212 1213 $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + common_welcomebar_widget ).css( 'bottom', new_welcombar_position ); 1214 new_welcombar_height_bottom_close = $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + common_welcomebar_widget ).outerHeight() - new_welcombar_position; 1215 1216 $( 'head' ).append( '<style class="mysticky_bottom_style" type="text/css">html.mysticky-welcomebar-apper {padding-bottom: ' + new_welcomebar_height + 'px}</style>' ); 1217 new_welcombar_padding_bottom_close = new_welcombar_padding_bottom_close + $( '.mysticky-welcomebar-fixed.mysticky-welcomebar-widget-' + common_welcomebar_widget ).outerHeight(); 1218 } else { 1219 var welcomebar_fixed_length = $( '.mysticky-welcomebar-fixed' ).length; 1220 var welcomebar_notapper_length = $( '.mysticky-welcomebar-notapper' ).length; 1221 var welcomebar_notapper_bottom_length = $( '.mysticky-welcomebar-position-bottom.mysticky-welcomebar-notapper' ).length; 1222 var welcomebar_notpresent_bottom_length = $( '.mysticky-welcomebar-position-bottom.mysticky-welcomebar-notpresent' ).length; 1223 var welcomebar_bottom_length = $( '.mysticky-welcomebar-position-bottom' ).length; 1224 1225 if( welcomebar_notapper_length == welcomebar_fixed_length || welcomebar_bottom_length == welcomebar_notapper_bottom_length || welcomebar_bottom_length == welcomebar_notpresent_bottom_length ) { 1226 $( 'head' ).append( '<style class="mysticky_bottom_style" type="text/css">html.mysticky-welcomebar-apper {padding-bottom: 0px}</style>' ); 1227 } 1228 } 1229 } 1230 } ); 1231 1232 jQuery( '#mysticky_divi_style' ).remove();
1233 jQuery( '.et_fixed_nav #top-header' ).css( 'top', '' ); 1234 1235 var mystickyelements_show = $( '.mystickyelements-fixed' ).length; 1236 if( mystickyelements_show && $( window ).width() <= 1024 && $( '.mystickyelements-fixed' ).hasClass( 'mystickyelements-position-mobile-top' ) && welcombar_position == 'top' ) { 1237 var mystickyelements_height = $( '.mystickyelements-fixed' ).height(); 1238 $( '.mystickyelements-fixed' ).css( 'top', '' ); 1239 $( 'html' ).attr( 'style', 'margin-top: ' + mystickyelements_height + 'px !important' ); 1240 } 1241 }, automatically_triggersec ); 1242 } 1243 } 1244 1245 1246}); 1247 1248 1249jQuery(".mysticky-welcomebar-fixed").on( 1250 "animationend MSAnimationEnd webkitAnimationEnd oAnimationEnd", 1251 function() { 1252 jQuery(this).removeClass("animation-start"); 1253 } 1254); 1255jQuery( document ).ready( function() { 1256 var container = jQuery( ".mysticky-welcomebar-fixed" ); 1257 var refreshId = setInterval( function() { 1258 container.addClass( "animation-start" ); 1259 }, 3500 ); 1260}); 1261 1262 1263/* Form submission validation function */ 1264 1265function IsEmail(email) { 1266 var regex = 1267/^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; 1268 if (!regex.test(email)) { 1269 return false; 1270 }else { 1271 return true; 1272 } 1273} 1274 1275function validatePhone(txtPhone) { 1276 var a = txtPhone; 1277 var filter = /^((\+[1-9]{1,4}[ \-]*)|(\([0-9]{2,3}\)[ \-]*)|([0-9]{2,4})[ \-]*)*?[0-9]{3,4}?[ \-]*[0-9]{3,4}?$/; 1278 if (filter.test(a)) { 1279 return true; 1280 }else { 1281 return false; 1282 } 1283}
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.