1(function($){ 2 var $et_pb_post_fullwidth = $( '.single.et_pb_pagebuilder_layout.et_full_width_page' ), 3 et_is_mobile_device = navigator.userAgent.match( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/ ), 4 et_is_ipad = navigator.userAgent.match( /iPad/ ), 5 $et_container = $( '.container' ), 6 et_container_width = $et_container.width(), 7 et_is_fixed_nav = $( 'body' ).hasClass( 'et_fixed_nav' ), 8 et_is_vertical_fixed_nav = $( 'body' ).hasClass( 'et_vertical_fixed' ), 9 et_is_rtl = $( 'body' ).hasClass( 'rtl' ), 10 et_hide_nav = $( 'body' ).hasClass( 'et_hide_nav' ), 11 et_header_style_left = $( 'body' ).hasClass( 'et_header_style_left' ), 12 et_vertical_navigation = $( 'body' ).hasClass( 'et_vertical_nav' ), 13 $top_header = $('#top-header'), 14 $main_header = $('#main-header'), 15 $main_container_wrapper = $( '#page-container' ), 16 $et_transparent_nav = $( '.et_transparent_nav' ), 17 $et_main_content_first_row = $( '#main-content .container:first-child' ), 18 $et_main_content_first_row_meta_wrapper = $et_main_content_first_row.find('.et_post_meta_wrapper:first'), 19 $et_main_content_first_row_meta_wrapper_title = $et_main_content_first_row_meta_wrapper.find( 'h1.entry-title' ), 20 $et_main_content_first_row_content = $et_main_content_first_row.find('.entry-content:first'), 21 $et_single_post = $( 'body.single-post' ), 22 $et_window = $(window), 23 etRecalculateOffset = false, 24 et_header_height, 25 et_header_modifier, 26 et_header_offset, 27 et_primary_header_top, 28 $et_vertical_nav = $('.et_vertical_nav'), 29 $et_header_style_split = $('.et_header_style_split'), 30 $et_top_navigation = $('#et-top-navigation'), 31 $logo = $('#logo'), 32 $et_pb_first_row = $( 'body.et_pb_pagebuilder_layout .et_pb_section:first-child' ), 33 et_is_touch_device = 'ontouchstart' in window || navigator.maxTouchPoints; 34 35 $(document).ready( function(){ 36 var $et_top_menu = $( 'ul.nav' ), 37 $et_search_icon = $( '#et_search_icon' ), 38 et_parent_menu_longpress_limit = 300, 39 et_parent_menu_longpress_start, 40 et_parent_menu_click = true; 41 42 $et_top_menu.find( 'li' ).hover( function() { 43 if ( ! $(this).closest( 'li.mega-menu' ).length || $(this).hasClass( 'mega-menu' ) ) { 44 $(this).addClass( 'et-show-dropdown' ); 45 $(this).removeClass( 'et-hover' ).addClass( 'et-hover' ); 46 } 47 }, function() { 48 var $this_el = $(this); 49 50 $this_el.removeClass( 'et-show-dropdown' ); 51 52 setTimeout( function() { 53 if ( ! $this_el.hasClass( 'et-show-dropdown' ) ) { 54 $this_el.removeClass( 'et-hover' ); 55 } 56 }, 200 ); 57 } ); 58 59 // Dropdown menu adjustment for touch screen 60 $et_top_menu.find('.menu-item-has-children > a').on( 'touchstart', function(){ 61 et_parent_menu_longpress_start = new Date().getTime(); 62 } ).on( 'touchend', function(){ 63 var et_parent_menu_longpress_end = new Date().getTime() 64 if ( et_parent_menu_longpress_end >= et_parent_menu_longpress_start + et_parent_menu_longpress_limit ) { 65 et_parent_menu_click = true; 66 } else { 67 et_parent_menu_click = false; 68 69 // Close sub-menu if toggled 70 var $et_parent_menu = $(this).parent('li'); 71 if ( $et_parent_menu.hasClass( 'et-hover') ) { 72 $et_parent_menu.trigger( 'mouseleave' ); 73 } else { 74 $et_parent_menu.trigger( 'mouseenter' ); 75 } 76 } 77 et_parent_menu_longpress_start = 0; 78 } ).click(function() { 79 if ( et_parent_menu_click ) { 80 return true; 81 } 82 83 return false; 84 } ); 85 86 $et_top_menu.find( 'li.mega-menu' ).each(function(){ 87 var $li_mega_menu = $(this), 88 $li_mega_menu_item = $li_mega_menu.children( 'ul' ).children( 'li' ), 89 li_mega_menu_item_count = $li_mega_menu_item.length; 90 91 if ( li_mega_menu_item_count < 4 ) { 92 $li_mega_menu.addClass( 'mega-menu-parent mega-menu-parent-' + li_mega_menu_item_count ); 93 } 94 }); 95 96 if ( $et_header_style_split.length && $et_vertical_nav.length < 1 ) { 97 function et_header_menu_split(){ 98 var $logo_container = $( '#main-header > .container > .logo_container' ), 99 $logo_container_splitted = $('.centered-inline-logo-wrap > .logo_container'), 100 et_top_navigation_li_size = $et_top_navigation.children('nav').children('ul').children('li').size(), 101 et_top_navigation_li_break_index = Math.round( et_top_navigation_li_size / 2 ) - 1; 102 103 if ( $et_window.width() > 980 && $logo_container.length ) { 104 $('<li class="centered-inline-logo-wrap"></li>').insertAfter($et_top_navigation.find('nav > ul >li:nth('+et_top_navigation_li_break_index+')') ); 105 $logo_container.appendTo( $et_top_navigation.find('.centered-inline-logo-wrap') ); 106 } 107 108 if ( $et_window.width() <= 980 && $logo_container_splitted.length ) { 109 $logo_container_splitted.prependTo('#main-header > .container'); 110 $('#main-header .centered-inline-logo-wrap').remove(); 111 } 112 } 113 et_header_menu_split(); 114 115 $(window).resize(function(){ 116 et_header_menu_split(); 117 }); 118 } 119 120 if ( $('ul.et_disable_top_tier').length ) { 121 $("ul.et_disable_top_tier > li > ul").prev('a').attr('href','#'); 122 } 123 124 if ( $( '.et_vertical_nav' ).length ) { 125 if ( $( '#main-header' ).height() < $( '#et-top-navigation' ).height() ) { 126 $( '#main-header' ).height( $( '#et-top-navigation' ).height() + $( '#logo' ).height() + 100 ); 127 } 128 } 129 130 window.et_calculate_header_values = function() { 131 var $top_header = $( '#top-header' ), 132 secondary_nav_height = $top_header.length && $top_header.is( ':visible' ) ? $top_header.innerHe
132ight() : 0, 133 admin_bar_height = $( '#wpadminbar' ).length ? $( '#wpadminbar' ).innerHeight() : 0, 134 $slide_menu_container = $( '.et_header_style_slide .et_slide_in_menu_container' ); 135 136 et_header_height = $( '#main-header' ).innerHeight() + secondary_nav_height, 137 et_header_modifier = et_header_height <= 90 ? et_header_height - 29 : et_header_height - 56, 138 et_header_offset = et_header_modifier + admin_bar_height; 139 140 et_primary_header_top = secondary_nav_height + admin_bar_height; 141 142 if ( $slide_menu_container.length && ! $( 'body' ).hasClass( 'et_pb_slide_menu_active' ) ) { 143 $slide_menu_container.css( { right: '-' + $slide_menu_container.innerWidth() + 'px', 'display' : 'none' } ); 144 145 if ( $( 'body' ).hasClass( 'et_boxed_layout' ) ) { 146 var page_container_margin = $main_container_wrapper.css( 'margin-left' ); 147 $main_header.css( { left : page_container_margin } ); 148 } 149 } 150 } 151 152 var $comment_form = $('#commentform'); 153 154 et_pb_form_placeholders_init( $comment_form ); 155 156 $comment_form.submit(function(){ 157 et_pb_remove_placeholder_text( $comment_form ); 158 }); 159 160 et_duplicate_menu( $('#et-top-navigation ul.nav'), $('#et-top-navigation .mobile_nav'), 'mobile_menu', 'et_mobile_menu' ); 161 et_duplicate_menu( '', $('.et_pb_fullscreen_nav_container'), 'mobile_menu_slide', 'et_mobile_menu', 'no_click_event' ); 162 163 if ( $( '#et-secondary-nav' ).length ) { 164 $('#et-top-navigation #mobile_menu').append( $( '#et-secondary-nav' ).clone().html() ); 165 } 166 167 // adding arrows for the slide/fullscreen menus 168 if ( $( '.et_slide_in_menu_container' ).length ) { 169 var $item_with_sub = $( '.et_slide_in_menu_container' ).find( '.menu-item-has-children > a' ); 170 // add arrows for each menu item which has submenu 171 if ( $item_with_sub.length ) { 172 $item_with_sub.append( '<span class="et_mobile_menu_arrow"></span>' ); 173 } 174 } 175 176 function et_change_primary_nav_position( delay ) { 177 setTimeout( function() { 178 var $body = $('body'), 179 $wpadminbar = $( '#wpadminbar' ), 180 $top_header = $( '#top-header' ), 181 et_primary_header_top = 0; 182 183 if ( $wpadminbar.length ) { 184 et_primary_header_top += $wpadminbar.innerHeight(); 185 } 186 187 if ( $top_header.length && $top_header.is(':visible') ) { 188 et_primary_header_top += $top_header.innerHeight(); 189 } 190 191 if ( ! $body.hasClass( 'et_vertical_nav' ) && ( $body.hasClass( 'et_fixed_nav' ) ) ) { 192 $('#main-header').css( 'top', et_primary_header_top ); 193 } 194 }, delay ); 195 } 196 197 function et_hide_nav_transofrm( ) { 198 var $body = $( 'body' ), 199 $body_height = $( document ).height(), 200 $viewport_height = $( window ).height() + et_header_height + 200; 201 202 if ( $body.hasClass( 'et_hide_nav' ) || $body.hasClass( 'et_hide_nav_disabled' ) && ( $body.hasClass( 'et_fixed_nav' ) ) ) { 203 if ( $body_height > $viewport_height ) { 204 if ( $body.hasClass( 'et_hide_nav_disabled' ) ) { 205 $body.addClass( 'et_hide_nav' ); 206 $body.removeClass( 'et_hide_nav_disabled' ); 207 } 208 $('#main-header').css( 'transform', 'translateY(-' + et_header_height +'px)' ); 209 $('#top-header').css( 'transform', 'translateY(-' + et_header_height +'px)' ); 210 } else { 211 $('#main-header').css( { 'transform': 'translateY(0)', 'opacity': '1' } ); 212 $('#top-header').css( { 'transform': 'translateY(0)', 'opacity': '1' } ); 213 $body.removeClass( 'et_hide_nav' ); 214 $body.addClass( 'et_hide_nav_disabled' ); 215 } 216 } 217 } 218 219 function et_page_load_scroll_to_anchor() { 220 var $map_container = $( window.et_location_hash + ' .et_pb_map_container' ), 221 $map = $map_container.children( '.et_pb_map' ), 222 $target = $( window.et_location_hash ); 223 224 // Make the target element visible again 225 $target.css( 'display', window.et_location_hash_style ); 226 227 var distance = ( 'undefined' !== typeof( $target.offset().top ) ) ? $target.offset().top : 0, 228 speed = ( distance > 4000 ) ? 1600 : 800; 229 230 if ( $map_container.length ) { 231 google.maps.event.trigger( $map[0], 'resize' ); 232 } 233 234 // Allow the header sizing functions enough time to finish before scrolling the page 235 setTimeout( function() { 236 et_pb_smooth_scroll( $target, false, speed, 'swing'); 237 238 // During the page scroll animation, the header's height might change. 239 // Do the scroll animation again to ensure its accuracy. 240 setTimeout( function() { 241 et_pb_smooth_scroll( $target, false, 150, 'linear' ); 242 }, speed + 25 ); 243 244 }, 700 ); 245 } 246 247 function et_fix_page_container_position(){ 248 var et_window_width = $et_window.width(), 249 $top_header = $( '#top-header' ), 250 secondary_nav_height = $top_header.length && $top_header.is( ':visible' ) ? $top_header.innerHe
250ight() : 0; 251 252 // Set data-height-onload for header if the page is loaded on large screen 253 // If the page is loaded from small screen, rely on data-height-onload printed on the markup, 254 // prevent window resizing issue from small to large 255 if ( et_window_width > 980 && ! $main_header.attr( 'data-height-loaded' ) ){ 256 $main_header.attr({ 'data-height-onload' : $main_header.height(), 'data-height-loaded' : true }); 257 } 258 259 // Use on page load calculation for large screen. Use on the fly calculation for small screen (980px below) 260 if ( et_window_width <= 980 ) { 261 var header_height = $main_header.innerHeight() + secondary_nav_height - 1; 262 263 // If transparent is detected, #main-content .container's padding-top needs to be added to header_height 264 // And NOT a pagebuilder page 265 if ( $et_transparent_nav.length && ! $et_pb_first_row.length ) { 266 header_height += 58; 267 } 268 } else { 269 270 // Get header height from header attribute 271 var header_height = parseInt( $main_header.attr( 'data-height-onload' ) ) + secondary_nav_height; 272 273 // Non page builder page needs to be added by #main-content .container's fixed height 274 if ( $et_transparent_nav.length && ! $et_vertical_nav.length && $et_main_content_first_row.length ) { 275 header_height += 58; 276 } 277 } 278 279 // Specific adjustment required for transparent nav + not vertical nav 280 if ( $et_transparent_nav.length && ! $et_vertical_nav.length ){ 281 282 // Add class for first row for custom section padding purpose 283 $et_pb_first_row.addClass( 'et_pb_section_first' ); 284 285 // List of conditionals 286 var is_pb = $et_pb_first_row.length, 287 is_post_pb = is_pb && $et_single_post.length, 288 is_post_pb_full_layout_has_title = $et_pb_post_fullwidth.length && $et_main_content_first_row_meta_wrapper_title.length, 289 is_post_pb_full_layout_no_title = $et_pb_post_fullwidth.length && 0 === $et_main_content_first_row_meta_wrapper_title.length, 290 is_pb_fullwidth_section_first = $et_pb_first_row.is( '.et_pb_fullwidth_section' ), 291 is_no_pb_mobile = et_window_width <= 980 && $et_main_content_first_row.length; 292 293 if ( is_post_pb && ! ( is_post_pb_full_layout_no_title && is_pb_fullwidth_section_first ) ) { 294 295 /* Desktop / Mobile + Single Post */ 296 297 /* 298 * EXCEPT for fullwidth layout + fullwidth section ( at the first row ). 299 * It is basically the same as page + fullwidth section with few quirk. 300 * Instead of duplicating the conditional for each module, it'll be simpler to negate 301 * fullwidth layout + fullwidth section in is_post_pb and rely it to is_pb_fullwidth_section_first 302 */ 303 304 // Remove main content's inline padding to styling to prevent looping padding-top calculation 305 $et_main_content_first_row.css({ 'paddingTop' : '' }); 306 307 if ( et_window_width < 980 ) { 308 header_height += 40; 309 } 310 311 if ( is_pb_fullwidth_section_first ) { 312 // If the first section is fullwidth, restore the padding-top modified area at first section 313 $et_pb_first_row.css({ 314 'paddingTop' : '0', 315 }); 316 } 317 318 if ( is_post_pb_full_layout_has_title ) { 319 320 // Add header height to post meta wrapper as padding top 321 $et_main_content_first_row_meta_wrapper.css({ 322 'paddingTop' : header_height 323 }); 324 325 } else if ( is_post_pb_full_layout_no_title ) { 326 327 $et_pb_first_row.css({ 328 'paddingTop' : header_height 329 }); 330 331 } else { 332 333 // Add header height to first row content as padding top 334 $et_main_content_first_row.css({ 335 'paddingTop' : header_height 336 }); 337 338 } 339 340 } else if ( is_pb_fullwidth_section_first ){ 341 342 /* Desktop / Mobile + Pagebuilder + Fullwidth Section */ 343 344 var $et_pb_first_row_first_module = $et_pb_first_row.children( '.et_pb_module:first' ); 345 346 // Quirks: If this is post with fullwidth layout + no title + fullwidth section at first row, 347 // Remove the added height at line 2656 348 if ( is_post_pb_full_layout_no_title && is_pb_fullwidth_section_first && et_window_width > 980 ) { 349 header_height = header_height - 58; 350 } 351 352 if ( $et_pb_first_row_first_module.is( '.et_pb_slider' ) ) { 353 354 /* Desktop / Mobile + Pagebuilder + Fullwidth slider */ 355 356 var $et_pb_first_row_first_module_slide_image = $et_pb_first_row_first_module.find( '.et_pb_slide_image' ), 357 $et_pb_first_row_first_module_slide = $et_pb_first_row_first_module.find( '.et_pb_slide' ), 358 $et_pb_first_row_first_module_slide_container = $et_pb_first_row_first_module.find( '.et_pb_slide .et_pb_container' ), 359 et_pb_slide_image_margin_top = 0 - ( parseInt( $et_pb_first_row_first_module_slide_image.height() ) / 2 ), 360 et_pb_slide_container_height = 0, 361 $et_pb_first_row_first_module_slider_arrow = $et_pb_first_row_first_module.find( '.et-pb-slider-arrows a'), 362 et_pb_first_row_slider_arrow_height = $et_pb_first_row_first_module_slider_arrow.height(); 363 364 // Adding padding top to each slide so the transparency become useful 365 $et_pb_first_row_first_module_slide.css({ 366 'paddingTop' : header_height, 367 }); 368 369 // delete container's min-height 370 $et_pb_first_row_first_module_slide_container.css({ 371 'min-height' : '' 372 }); 373 374 // Adjusting slider's image, considering additional top padding of slideshow 375 $et_pb_first_row_first_module_slide_image.css({ 376 'marginTop' : et_pb_slide_image_margin_top 377 }); 378 379 // Adjusting slider's arrow, considering additional top padding of slideshow 380 $et_pb_first_row_first_module_slider_arrow.css({ 381 'marginTop' : ( ( header_height / 2 ) - ( et_pb_first_row_slider_arrow_height / 2 ) ) 382 }); 383 384 // Looping the slide and get the highest height of slide 385 et_pb_first_row_slide_container_height_new = 0 386 387 $et_pb_first_row_first_module.find( '.et_pb_slide' ).each( function(){ 388 var $et_pb_first_row_first_module_slide_item = $(this), 389 $et_pb_first_row_first_module_slide_container = $et_pb_first_row_first_module_slide_item.find( '.et_pb_container' ); 390 391 // Make sure that the slide is visible to calculate correct height 392 $et_pb_first_row_first_module_slide_item.show(); 393 394 // Remove existing inline css to make sure that it calculates the height 395 $et_pb_first_row_first_module_slide_container.css({ 'min-height' : '' }); 396 397 var et_pb_first_row_slide_container_height = $et_pb_first_row_first_module_slide_container.innerHe
397ight(); 398 399 if ( et_pb_first_row_slide_container_height_new < et_pb_first_row_slide_container_height ){ 400 et_pb_first_row_slide_container_height_new = et_pb_first_row_slide_container_height; 401 } 402 403 // Hide the slide back if it isn't active slide 404 if ( $et_pb_first_row_first_module_slide_item.is( ':not(".et-pb-active-slide")' ) ){ 405 $et_pb_first_row_first_module_slide_item.hide(); 406 } 407 }); 408 409 // Setting appropriate min-height, considering additional top padding of slideshow 410 $et_pb_first_row_first_module_slide_container.css({ 411 'min-height' : et_pb_first_row_slide_container_height_new 412 }); 413 414 } else if ( $et_pb_first_row_first_module.is( '.et_pb_fullwidth_header' ) ) { 415 416 /* Desktop / Mobile + Pagebuilder + Fullwidth header */ 417 418 // Remove existing inline stylesheet to prevent looping padding 419 $et_pb_first_row_first_module.removeAttr( 'style' ); 420 421 // Get paddingTop from stylesheet 422 var et_pb_first_row_first_module_fullwidth_header_padding_top = parseInt( $et_pb_first_row_first_module.css( 'paddingTop' ) ); 423 424 // Implement stylesheet's padding-top + header_height 425 $et_pb_first_row_first_module.css({ 426 'paddingTop' : ( header_height + et_pb_first_row_first_module_fullwidth_header_padding_top ) 427 } ); 428 429 } else if ( $et_pb_first_row_first_module.is( '.et_pb_fullwidth_portfolio' ) ) { 430 431 /* Desktop / Mobile + Pagebuilder + Fullwidth Portfolio */ 432 433 $et_pb_first_row_first_module.css({ 'paddingTop' : header_height }); 434 435 } else if ( $et_pb_first_row_first_module.is( '.et_pb_map_container' ) ) { 436 437 /* Desktop / Mobile + Pagebuilder + Fullwidth Map */ 438 439 var $et_pb_first_row_map = $et_pb_first_row_first_module.find( '.et_pb_map' ); 440 441 // Remove existing inline height to prevent looping height calculation 442 $et_pb_first_row_map.css({ 'height' : '' }); 443 444 // Implement map height + header height 445 $et_pb_first_row_first_module.find('.et_pb_map').css({ 446 'height' : header_height + parseInt( $et_pb_first_row_map.css( 'height' ) ) 447 }); 448 449 // Adding specific class to mark the map as first row section element 450 $et_pb_first_row_first_module.addClass( 'et_beneath_transparent_nav' ); 451 452 } else if ( $et_pb_first_row_first_module.is( '.et_pb_fullwidth_menu' ) ) { 453 454 /* Desktop / Mobile + Pagebuilder + Fullwidth Menu */ 455 $et_pb_first_row_first_module.css({ 'marginTop' : header_height }); 456 457 } else if ( $et_pb_first_row_first_module.is( '.et_pb_fullwidth_code' ) ) { 458 459 /* Desktop / Mobile + Pagebuilder + Fullwidth code */ 460 461 var $et_pb_first_row_first_module_code = $et_pb_first_row_first_module; 462 463 $et_pb_first_row_first_module_code.css({ 'paddingTop' : '' }); 464 465 var et_pb_first_row_first_module_code_padding_top = parseInt( $et_pb_first_row_first_module_code.css( 'paddingTop' ) ); 466 467 $et_pb_first_row_first_module_code.css({ 468 'paddingTop' : header_height + et_pb_first_row_first_module_code_padding_top 469 }); 470 471 } else if ( $et_pb_first_row_first_module.is( '.et_pb_post_title' ) ) { 472 473 /* Desktop / Mobile + Pagebuilder + Fullwidth Post Title */ 474 475 var $et_pb_first_row_first_module_title = $et_pb_first_row_first_module; 476 477 $et_pb_first_row_first_module_title.css({ 478 'paddingTop' : header_height + 50 479 }); 480 } 481 482 } else if ( is_pb ) { 483 484 /* Desktop / Mobile + Pagebuilder + Regular section */ 485 486 // Remove first row's inline padding top styling to prevent looping padding-top calculation 487 $et_pb_first_row.css({ 'paddingTop' : '' }); 488 489 // Pagebuilder ignores #main-content .container's fixed height and uses its row's padding 490 // Anticipate the use of custom section padding. 491 et_pb_first_row_padding_top = header_height + parseInt( $et_pb_first_row.css( 'paddingBottom' ) ); 492 493 // Implementing padding-top + header_height 494 $et_pb_first_row.css({ 495 'paddingTop' : et_pb_first_row_padding_top 496 }); 497 498 } else if ( is_no_pb_mobile ) { 499 500 // Mobile + not pagebuilder 501 $et_main_content_first_row.css({ 502 'paddingTop' : header_height 503 }); 504 505 } else { 506 507 $('#main-content .container:first-child').css({ 508 'paddingTop' : header_height 509 }); 510 511 } 512 513 // Set #page-container's padding-top to zero after inline styling first row's content has been added 514 if ( ! $('#et_fix_page_container_position').length ){ 515 $( '<style />', { 516 'id' : 'et_fix_page_container_position', 517 'text' : '#page-container{ padding-top: 0 !important;}' 518 }).appendTo('head'); 519 } 520 521 } else if( et_is_fixed_nav ) { 522 523 $main_container_wrapper.css( 'paddingTop', header_height ); 524 525 } 526 527 et_change_primary_nav_position( 0 ); 528 } 529 530 // Save container width on page load for reference 531 $et_container.data( 'previous-width', $et_container.width() ); 532 533 $( window ).resize( function(){ 534 var window_width = $et_window.width(), 535 et_container_previous_width = $et_container.data('previous-width'),
536 et_container_css_width = $et_container.css( 'width' ), 537 et_container_width_in_pixel = ( typeof et_container_css_width !== 'undefined' ) ? et_container_css_width.substr( -1, 1 ) !== '%' : '', 538 et_container_actual_width = ( et_container_width_in_pixel ) ? $et_container.width() : ( ( $et_container.width() / 100 ) * window_width ), // $et_container.width() doesn't recognize pixel or percentage unit. It's our duty to understand what it returns and convert it properly 539 containerWidthChanged = et_container_previous_width !== et_container_actual_width, 540 $slide_menu_container = $( '.et_slide_in_menu_container' ); 541 542 if ( et_is_fixed_nav && containerWidthChanged ) { 543 if ( typeof update_page_container_position != 'undefined' ){ 544 clearTimeout( update_page_container_position ); 545 } 546 547 var update_page_container_position = setTimeout( function() { 548 et_fix_page_container_position(); 549 if ( typeof et_fix_fullscreen_section === 'function' ) { 550 et_fix_fullscreen_section(); 551 } 552 }, 200 ); 553 554 // Update container width data for future resizing reference 555 $et_container.data('previous-width', et_container_actual_width ); 556 } 557 558 if ( et_hide_nav ) { 559 et_hide_nav_transofrm(); 560 } 561 562 if ( $( '#wpadminbar' ).length && et_is_fixed_nav && window_width >= 740 && window_width <= 782 ) { 563 et_calculate_header_values(); 564 565 et_change_primary_nav_position( 0 ); 566 } 567 568 et_set_search_form_css(); 569 570 if ( $slide_menu_container.length && ! $( 'body' ).hasClass( 'et_pb_slide_menu_active' ) ) { 571 $slide_menu_container.css( { right: '-' + $slide_menu_container.innerWidth() + 'px' } ); 572 573 if ( $( 'body' ).hasClass( 'et_boxed_layout' ) && et_is_fixed_nav ) { 574 var page_container_margin = $main_container_wrapper.css( 'margin-left' ); 575 $main_header.css( { left : page_container_margin } ); 576 } 577 } 578 579 if ( $slide_menu_container.length && $( 'body' ).hasClass( 'et_pb_slide_menu_active' ) ) { 580 if ( $( 'body' ).hasClass( 'et_boxed_layout' ) ) { 581 var page_container_margin = parseFloat( $main_container_wrapper.css( 'margin-left' ) ), 582 left_position; 583 584 $main_container_wrapper.css( { left: '-' + ( $slide_menu_container.innerWidth() - page_container_margin ) + 'px' } ); 585 586 if ( et_is_fixed_nav ) { 587 left_position = 0 > $slide_menu_container.innerWidth() - ( page_container_margin * 2 ) ? Math.abs( $slide_menu_container.innerWidth() - ( page_container_margin * 2 ) ) : '-' + ( $slide_menu_container.innerWidth() - ( page_container_margin * 2 ) ); 588 589 if ( left_position < $slide_menu_container.innerWidth() ) { 590 $main_header.css( { left: left_position + 'px' } ); 591 } 592 } 593 } else { 594 $( '#page-container, .et_fixed_nav #main-header' ).css( { left: '-' + $slide_menu_container.innerWidth() + 'px' } ); 595 } 596 } 597 598 // adjust the padding in fullscreen menu 599 if ( $slide_menu_container.length && $( 'body' ).hasClass( 'et_header_style_fullscreen' ) ) { 600 var top_bar_height = $slide_menu_container.find( '.et_slide_menu_top' ).innerHeight(); 601 602 $slide_menu_container.css( { 'padding-top': top_bar_height + 20 } ); 603 } 604 } ); 605 606 $( window ).ready( function(){ 607 if ( $.fn.fitVids ) { 608 $( '#main-content' ).fitVids( { customSelector: "iframe[src^='http://www.hulu.com'], iframe[src^='http://www.dailymotion.com'], iframe[src^='http://www.funnyordie.com'], iframe[src^='https://embed-ssl.ted.com'], iframe[src^='http://embed.revision3.com'], iframe[src^='https://flickr.com'], iframe[src^='http://blip.tv'], iframe[src^='http://www.collegehumor.com']"} ); 609 } 610 } ); 611 612 $( window ).load( function(){ 613 if ( et_is_fixed_nav ) { 614 et_calculate_header_values(); 615 } 616 617 et_fix_page_container_position(); 618 619 if ( window.hasOwnProperty( 'et_location_hash' ) && '' !== window.et_location_hash ) { 620 // Handle the page scroll that we prevented earlier in the <head> 621 et_page_load_scroll_to_anchor(); 622 } 623 624 if ( et_header_style_left && !et_vertical_navigation) { 625 $logo_width = $( '#logo' ).width(); 626 if ( et_is_rtl ) { 627 $et_top_navigation.css( 'padding-right', $logo_width + 30 ); 628 } else { 629 $et_top_navigation.css( 'padding-left', $logo_width + 30 ); 630 } 631 } 632 633 if ( $('p.demo_store').length ) { 634 $('#footer-bottom').css('margin-bottom' , $('p.demo_store').innerHeight()); 635 } 636 637 if ( $.fn.waypoint ) { 638 if ( et_is_vertical_fixed_nav ) { 639 var $waypoint_selector = $('#main-content'); 640 641 $waypoint_selector.waypoint( { 642 handler : function( direction ) { 643 et_fix_logo_transition(); 644 645 if ( direction === 'down' ) { 646 $('#main-header').addClass( 'et-fixed-header' ); 647 } else { 648 $('#main-header').removeClass( 'et-fixed-header' ); 649 } 650 } 651 } ); 652 } 653 654 if ( et_is_fixed_nav ) { 655 656 if ( $et_transparent_nav.length && ! $et_vertical_nav.length && $et_pb_first_row.length ){ 657 658 // Fullscreen section at the first row requires specific adjustment 659 if ( $et_pb_first_row.is( '.et_pb_fullwidth_section' ) ){ 660 var $waypoint_selector = $et_pb_first_row.children('.et_pb_module'); 661 } else { 662 var $waypoint_selector = $et_pb_first_row.find('.et_pb_row'); 663 } 664 } else if ( $et_transparent_nav.length && ! $et_vertical_nav.length && $et_main_content_first_row.length ) { 665 var $waypoint_selector = $('#content-area'); 666 } else { 667 var $waypoint_selector = $('#main-content'); 668 } 669 670 $waypoint_selector.waypoint( { 671 offset: function() { 672 if ( etRecalculateOffset ) { 673 setTimeout( function() { 674 et_calculate_header_values(); 675 }, 200 ); 676 677 etRecalculateOffset = false;
678 } 679 if ( et_hide_nav ) { 680 return et_header_offset - et_header_height - 200; 681 } else { 682 683 // Transparent nav modification: #page-container's offset is set to 0. Modify et_header_offset's according to header height 684 var waypoint_selector_offset = $waypoint_selector.offset(); 685 686 if ( waypoint_selector_offset.top < et_header_offset ) { 687 et_header_offset = 0 - ( et_header_offset - waypoint_selector_offset.top ); 688 } 689 690 return et_header_offset; 691 } 692 }, 693 handler : function( direction ) { 694 et_fix_logo_transition(); 695 696 if ( direction === 'down' ) { 697 $main_header.addClass( 'et-fixed-header' ); 698 $main_container_wrapper.addClass ( 'et-animated-content' ); 699 $top_header.addClass( 'et-fixed-header' ); 700 701 if ( ! et_hide_nav && ! $et_transparent_nav.length && ! $( '.mobile_menu_bar_toggle' ).is(':visible') ) { 702 var secondary_nav_height = $top_header.height(), 703 et_is_vertical_nav = $( 'body' ).hasClass( 'et_vertical_nav' ), 704 $clone_header, 705 clone_header_height, 706 fix_padding; 707 708 $clone_header = $main_header.clone().addClass( 'et-fixed-header, et_header_clone' ).css( { 'transition': 'none', 'display' : 'none' } ); 709 710 clone_header_height = $clone_header.prependTo( 'body' ).height(); 711 712 // Vertical nav doesn't need #page-container margin-top adjustment 713 if ( ! et_is_vertical_nav ) { 714 fix_padding = parseInt( $main_container_wrapper.css( 'padding-top' ) ) - clone_header_height - secondary_nav_height + 1 ; 715 716 $main_container_wrapper.css( 'margin-top', -fix_padding ); 717 } 718 719 $( '.et_header_clone' ).remove(); 720 } 721 722 } else { 723 $main_header.removeClass( 'et-fixed-header' ); 724 $top_header.removeClass( 'et-fixed-header' ); 725 $main_container_wrapper.css( 'margin-top', '-1px' ); 726 } 727 setTimeout( function() { 728 et_set_search_form_css(); 729 }, 400 ); 730 } 731 } ); 732 } 733 734 if ( et_hide_nav ) { 735 et_hide_nav_transofrm(); 736 } 737 } 738 } ); 739 740 $( 'a[href*="#"]:not([href="#"])' ).click( function() { 741 var $this_link = $( this ), 742 has_closest_smooth_scroll_disabled = $this_link.closest( '.et_smooth_scroll_disabled' ).length, 743 has_closest_woocommerce_tabs = ( $this_link.closest( '.woocommerce-tabs' ).length && $this_link.closest( '.tabs' ).length ), 744 has_closest_eab_cal_link = $this_link.closest( '.eab-shortcode_calendar-navigation-link' ).length, 745 has_acomment_reply = $this_link.hasClass( 'acomment-reply' ), 746 disable_scroll = has_closest_smooth_scroll_disabled || has_closest_woocommerce_tabs || has_closest_eab_cal_link || has_acomment_reply; 747 748 if ( ( location.pathname.replace( /^\//,'' ) == this.pathname.replace( /^\//,'' ) && location.hostname == this.hostname ) && ! disable_scroll ) { 749 var target = $( this.hash ); 750 target = target.length ? target : $( '[name=' + this.hash.slice(1) +']' ); 751 if ( target.length ) { 752 753 et_pb_smooth_scroll( target, false, 800 ); 754 755 if ( ! $( '#main-header' ).hasClass( 'et-fixed-header' ) && $( 'body' ).hasClass( 'et_fixed_nav' ) && $( window ).width() > 980 ) { 756 setTimeout(function(){ 757 et_pb_smooth_scroll( target, false, 40, 'linear' ); 758 }, 780 ); 759 } 760 761 return false; 762 } 763 } 764 }); 765 766 if ( $( '.et_pb_section' ).length > 1 && $( '.et_pb_side_nav_page' ).length ) { 767 var $i=0; 768 769 $( '#main-content' ).append( '<ul class="et_pb_side_nav"></ul>' ); 770 771 $( '.et_pb_section' ).each( function(){ 772 if ( $( this ).height() > 0 ) { 773 $active_class = $i == 0 ? 'active' : ''; 774 $( '.et_pb_side_nav' ).append( '<li class="side_nav_item"><a href="#" id="side_nav_item_id_' + $i + '" class= "' + $active_class + '">' + $i + '</a></li>' ); 775 $( this ).addClass( 'et_pb_scroll_' + $i ); 776 $i++; 777 } 778 }); 779 780 $side_nav_offset = ( $i * 20 + 40 ) / 2; 781 $( 'ul.et_pb_side_nav' ).css( 'marginTop', '-' + parseInt( $side_nav_offset) + 'px' ); 782 $( '.et_pb_side_nav' ).addClass( 'et-visible' ); 783 784 785 $( '.et_pb_side_nav a' ).click( function(){ 786 $top_section = ( $( this ).text() == "0" ) ? true : false;
787 $target = $( '.et_pb_scroll_' + $( this ).text() ); 788 789 et_pb_smooth_scroll( $target, $top_section, 800); 790 791 if ( ! $( '#main-header' ).hasClass( 'et-fixed-header' ) && $( 'body' ).hasClass( 'et_fixed_nav' ) && $( window ).width() > 980 ) { 792 setTimeout(function(){ 793 et_pb_smooth_scroll( $target, $top_section, 200); 794 },500); 795 } 796 797 return false; 798 }); 799 800 $( window ).scroll( function(){ 801 802 $add_offset = ( $( 'body' ).hasClass( 'et_fixed_nav' ) ) ? 20 : -90; 803 804 if ( $ ( '#wpadminbar' ).length && $( window ).width() > 600 ) { 805 $add_offset += $( '#wpadminbar' ).outerHeight(); 806 } 807 808 $side_offset = ( $( 'body' ).hasClass( 'et_vertical_nav' ) ) ? $( '#top-header' ).height() + $add_offset + 60 : $( '#top-header' ).height() + $( '#main-header' ).height() + $add_offset; 809 810 for ( var $i = 0; $i <= $( '.side_nav_item a' ).length - 1; $i++ ) { 811 if ( $( window ).scrollTop() + $( window ).height() == $( document ).height() ) { 812 $last = $( '.side_nav_item a' ).length - 1; 813 $( '.side_nav_item a' ).removeClass( 'active' ); 814 $( 'a#side_nav_item_id_' + $last ).addClass( 'active' ); 815 } else { 816 if ( $( this ).scrollTop() >= $( '.et_pb_scroll_' + $i ).offset().top - $side_offset ) { 817 $( '.side_nav_item a' ).removeClass( 'active' ); 818 $( 'a#side_nav_item_id_' + $i ).addClass( 'active' ); 819 } 820 } 821 } 822 }); 823 } 824 825 if ( $('.et_pb_scroll_top').length ) { 826 $(window).scroll(function(){ 827 if ($(this).scrollTop() > 800) { 828 $('.et_pb_scroll_top').show().removeClass( 'et-hidden' ).addClass( 'et-visible' ); 829 } else { 830 $('.et_pb_scroll_top').removeClass( 'et-visible' ).addClass( 'et-hidden' ); 831 } 832 }); 833 834 //Click event to scroll to top 835 $('.et_pb_scroll_top').click(function(){ 836 $('html, body').animate({scrollTop : 0},800); 837 }); 838 } 839 840 if ( $( '.comment-reply-link' ).length ) { 841 $( '.comment-reply-link' ).addClass( 'et_pb_button' ); 842 } 843 844 $( '#et_top_search' ).click( function() { 845 var $search_container = $( '.et_search_form_container' ); 846 847 if ( $search_container.hasClass('et_pb_is_animating') ) { 848 return; 849 } 850 851 $( '.et_menu_container' ).removeClass( 'et_pb_menu_visible et_pb_no_animation' ).addClass('et_pb_menu_hidden'); 852 $search_container.removeClass( 'et_pb_search_form_hidden et_pb_no_animation' ).addClass('et_pb_search_visible et_pb_is_animating'); 853 setTimeout( function() { 854 $( '.et_menu_container' ).addClass( 'et_pb_no_animation' ); 855 $search_container.addClass( 'et_pb_no_animation' ).removeClass('et_pb_is_animating'); 856 }, 1000); 857 $search_container.find( 'input' ).focus(); 858 859 et_set_search_form_css(); 860 }); 861 862 function et_hide_search() { 863 if ( $( '.et_search_form_container' ).hasClass('et_pb_is_animating') ) { 864 return; 865 } 866 867 $( '.et_menu_container' ).removeClass( 'et_pb_menu_hidden et_pb_no_animation' ).addClass( 'et_pb_menu_visible' ); 868 $( '.et_search_form_container' ).removeClass('et_pb_search_visible et_pb_no_animation' ).addClass( 'et_pb_search_form_hidden et_pb_is_animating' ); 869 setTimeout( function() { 870 $( '.et_menu_container' ).addClass( 'et_pb_no_animation' ); 871 $( '.et_search_form_container' ).addClass( 'et_pb_no_animation' ).removeClass('et_pb_is_animating'); 872 }, 1000); 873 } 874 875 function et_set_search_form_css() { 876 var $search_container = $( '.et_search_form_container' ); 877 var $body = $( 'body' ); 878 if ( $search_container.hasClass( 'et_pb_search_visible' ) ) { 879 var header_height = $( '#main-header' ).innerHeight(), 880 menu_width = $( '#top-menu' ).width(), 881 font_size = $( '#top-menu li a' ).css( 'font-size' ); 882 $search_container.css( { 'height' : header_height + 'px' } ); 883 $search_container.find( 'input' ).css( 'font-size', font_size ); 884 if ( ! $body.hasClass( 'et_header_style_left' ) ) { 885 $search_container.css( 'max-width', menu_width + 60 ); 886 } else { 887 $search_container.find( 'form' ).css( 'max-width', menu_width + 60 ); 888 } 889 } 890 } 891 892 $( '.et_close_search_field' ).click( function() { 893 et_hide_search(); 894 }); 895 896 $( document ).mouseup( function(e) { 897 var $header = $( '#main-header' ); 898 if ( $( '.et_menu_container' ).hasClass('et_pb_menu_hidden') ) { 899 if ( ! $header.is( e.target ) && $header.has( e.target ).length === 0 ) { 900 et_hide_search(); 901 } 902 } 903 }); 904 905 // Detect actual logo dimension, used for tricky fixed navigation transition 906 function et_define_logo_dimension() { 907 var $logo = $('#logo'), 908 logo_src = $logo.attr( 'src' ), 909 is_svg = logo_src.substr( -3, 3 ) === 'svg' ? true : false, 910 $logo_wrap, 911 logo_width, 912 logo_height; 913 914 // Append invisible wrapper at the bottom of the page 915 $('body').append( $('<div />', { 916 'id' : 'et-define-logo-wrap', 917 'style' : 'position: fixed; bottom: 0; opacity: 0;' 918 })); 919 920 // Define logo wrap 921 $logo_wrap = $('#et-define-logo-wrap'); 922 923 if( is_svg ) { 924 $logo_wrap.addClass( 'svg-logo' ); 925 } 926 927 // Clone logo to invisible wrapper 928 $logo_wrap.html( $logo.clone().css({ 'display' : 'block' }).removeAttr( 'id' ) ); 929 930 // Get dimension 931 logo_width = $logo_wrap.find('img').width(); 932 logo_height = $logo_wrap.find('img').height(); 933 934 // Add data attribute to $logo 935 $logo.attr({ 936 'data-actual-width' : logo_width, 937 'data-actual-height' : logo_height 938 }); 939 940 // Destroy invisible wrapper 941 $logo_wrap.remove(); 942 943 // Init logo transition onload 944 et_fix_logo_transition( true ); 945 } 946 947 if ( $('#logo').length ) { 948 // Wait until logo is loaded before performing logo dimension fix 949 // This comes handy when the page is heavy due to the use of images or other assets 950 $('#logo').attr( 'src', $('#logo').attr('src') ).load( function(){ 951 et_define_logo_dimension(); 952 } ); 953 } 954 955 // Set width for adsense in footer widget 956 $('.footer-widget').each(function(){ 957 var $footer_widget = $(this), 958 footer_widget_width = $footer_widget.width(), 959 $adsense_ins = $footer_widget.find( '.widget_adsensewidget ins' ); 960 961 if ( $adsense_ins.length ) { 962 $adsense_ins.width( footer_widget_width ); 963 } 964 }); 965 } ); 966 967 // Fixing logo size transition in tricky header style 968 function et_fix_logo_transition( is_onload ) { 969 var $body = $( 'body' ), 970 $logo = $( '#logo' ), 971 logo_actual_width = parseInt( $logo.attr( 'data-actual-width' ) ), 972 logo_actual_height = parseInt( $logo.attr( 'data-actual-height' ) ), 973 logo_height_percentage = parseInt( $logo.attr( 'data-height-percentage' ) ), 974 $top_nav = $( '#et-top-navigation' ), 975 top_nav_height = parseInt( $top_nav.attr( 'data-height' ) ), 976 top_nav_fixed_height = parseInt( $top_nav.attr( 'data-fixed-height' ) ), 977 $main_header = $('#main-header'), 978 is_header_split = $body.hasClass( 'et_header_style_split' ), 979 is_fixed_nav = $main_header.hasClass( 'et-fixed-header' ), 980 is_vertical_nav = $body.hasClass( 'et_vertical_nav' ), 981 is_hide_primary_logo = $body.hasClass( 'et_hide_primary_logo' ), 982 is_hide_fixed_logo = $body.hasClass( 'et_hide_fixed_logo' ), 983 is_onload = typeof is_onload === 'undefined' ? false : is_onload, 984 logo_height_base = is_fixed_nav ? top_nav_height : top_nav_fixed_height, 985 logo_wrapper_width, 986 logo_wrapper_height; 987 988 // Fix for inline centered logo in horizontal nav 989 if ( is_header_split && ! is_vertical_nav ) { 990 // On page load, logo_height_base should be top_nav_height 991 if ( is_onload ) { 992 logo_height_base = top_nav_height; 993 } 994 995 // Calculate logo wrapper height 996 logo_wrapper_height = ( logo_height_base * ( logo_height_percentage / 100 ) + 22 ); 997 998 // Calculate logo wrapper width 999 logo_wrapper_width = logo_actual_width * ( logo_wrapper_height / logo_actual_height ); 1000 1001 // Override logo wrapper width to 0 if it is hidden 1002 if ( is_hide_primary_logo && ( is_fixed_nav || is_onload ) ) { 1003 logo_wrapper_width = 0; 1004 } 1005 1006 if ( is_hide_fixed_logo && ! is_fixed_nav && ! is_onload ) { 1007 logo_wrapper_width = 0; 1008 } 1009
1010 // Set fixed width for logo wrapper to force correct dimension 1011 $( '.et_header_style_split .centered-inline-logo-wrap' ).css( { 'width' : logo_wrapper_width } ); 1012 } 1013 } 1014 1015 function et_toggle_slide_menu( force_state ) { 1016 var $slide_menu_container = $( '.et_header_style_slide .et_slide_in_menu_container' ), 1017 $page_container = $( '.et_header_style_slide #page-container, .et_header_style_slide.et_fixed_nav #main-header' ), 1018 $header_container = $( '.et_header_style_slide #main-header' ), 1019 is_menu_opened = $slide_menu_container.hasClass( 'et_pb_slide_menu_opened' ), 1020 set_to = typeof force_state !== 'undefined' ? force_state : 'auto', 1021 is_boxed_layout = $( 'body' ).hasClass( 'et_boxed_layout' ), 1022 page_container_margin = is_boxed_layout ? parseFloat( $( '#page-container' ).css( 'margin-left' ) ) : 0, 1023 slide_container_width = $slide_menu_container.innerWidth(); 1024 1025 if ( 'auto' !== set_to && ( ( is_menu_opened && 'open' === set_to ) || ( ! is_menu_opened && 'close' === set_to ) ) ) { 1026 return; 1027 } 1028 1029 if ( is_menu_opened ) { 1030 $slide_menu_container.css( { right: '-' + slide_container_width + 'px' } ); 1031 $page_container.css( { left: '0' } ); 1032 1033 if ( is_boxed_layout && et_is_fixed_nav ) { 1034 $header_container.css( { left : page_container_margin + 'px' } ); 1035 } 1036 1037 // hide the menu after animation completed 1038 setTimeout( function() { 1039 $slide_menu_container.css( { 'display' : 'none' } ); 1040 }, 700 ); 1041 } else { 1042 $slide_menu_container.css( { 'display' : 'block' } ); 1043 // add some delay to make sure css animation applied correctly 1044 setTimeout( function() { 1045 $slide_menu_container.css( { right: '0' } ); 1046 $page_container.css( { left: '-' + ( slide_container_width - page_container_margin ) + 'px' } ); 1047 1048 if ( is_boxed_layout && et_is_fixed_nav ) { 1049 var left_position = 0 > slide_container_width - ( page_container_margin * 2 ) ? Math.abs( slide_container_width - ( page_container_margin * 2 ) ) : '-' + ( slide_container_width - ( page_container_margin * 2 ) ); 1050 1051 if ( left_position < slide_container_width ) { 1052 $header_container.css( { left: left_position + 'px' } ); 1053 } 1054 } 1055 }, 50 ); 1056 } 1057 1058 $( 'body' ).toggleClass( 'et_pb_slide_menu_active' ); 1059 $slide_menu_container.toggleClass( 'et_pb_slide_menu_opened' ); 1060 } 1061 1062 $( '#main-header' ).on( 'click', '.et_toggle_slide_menu', function() { 1063 et_toggle_slide_menu(); 1064 }); 1065 1066 if ( et_is_touch_device ) { 1067 // open slide menu on swipe left 1068 $et_window.on( 'swipeleft', function( event ) { 1069 var window_width = parseInt( $et_window.width() ), 1070 swipe_start = parseInt( event.swipestart.coords[0] ); // horizontal coordinates of the swipe start 1071 1072 // if swipe started from the right edge of screen then open slide menu 1073 if ( 30 >= window_width - swipe_start ) { 1074 et_toggle_slide_menu( 'open' ); 1075 } 1076 } ); 1077 1078 // close slide menu on swipe right 1079 $et_window.on( 'swiperight', function( event ){ 1080 if ( $( 'body' ).hasClass( 'et_pb_slide_menu_active' ) ) { 1081 et_toggle_slide_menu( 'close' ); 1082 } 1083 }); 1084 } 1085 1086 $( '#page-container' ).on( 'click', '.et_toggle_fullscreen_menu', function() { 1087 var $menu_container = $( '.et_header_style_fullscreen .et_slide_in_menu_container' ), 1088 top_bar_height = $menu_container.find( '.et_slide_menu_top' ).innerHeight(); 1089 1090 $menu_container.toggleClass( 'et_pb_fullscreen_menu_opened' ); 1091 $( 'body' ).toggleClass( 'et_pb_fullscreen_menu_active' ); 1092 1093 if ( $menu_container.hasClass( 'et_pb_fullscreen_menu_opened' ) ) { 1094 $menu_container.addClass( 'et_pb_fullscreen_menu_animated' ); 1095 1096 // adjust the padding in fullscreen menu 1097 $menu_container.css( { 'padding-top': top_bar_height + 20 } ); 1098 } else { 1099 setTimeout( function() { 1100 $menu_container.removeClass( 'et_pb_fullscreen_menu_animated' ); 1101 }, 1000 ); 1102 } 1103 }); 1104 1105 $( '.et_pb_fullscreen_nav_container' ).on( 'click', 'li.menu-item-has-children > a', function() { 1106 var $this_parent = $( this ).closest( 'li' ), 1107 $this_arrow = $this_parent.find( '>a .et_mobile_menu_arrow' ), 1108 $closest_submenu = $this_parent.find( '>ul' ), 1109 is_opened_submenu = $this_arrow.hasClass( 'et_pb_submenu_opened' ), 1110 sub_menu_max_height; 1111 1112 $this_arrow.toggleClass( 'et_pb_submenu_opened' ); 1113 1114 if ( is_opened_submenu ) { 1115 $closest_submenu.removeClass( 'et_pb_slide_dropdown_opened' ); 1116 $closest_submenu.slideToggle( 700, 'easeInOutCubic' ); 1117 } else { 1118 $closest_submenu.slideToggle( 700, 'easeInOutCubic' ); 1119 $closest_submenu.addClass( 'et_pb_slide_dropdown_opened' ); 1120 } 1121 1122 return false;
1123 } ); 1124 1125 // define initial padding-top for fullscreen menu container 1126 if ( $( 'body' ).hasClass( 'et_header_style_fullscreen' ) ) { 1127 var $menu_container = $( '.et_header_style_fullscreen .et_slide_in_menu_container' ); 1128 1129 if ( $menu_container.length ) { 1130 var top_bar_height = $menu_container.find( '.et_slide_menu_top' ).innerHeight(); 1131 $menu_container.css( { 'padding-top': top_bar_height + 20 } ); 1132 } 1133 } 1134 1135 $("#et_search_icon").click(function(){ 1136 console.log('Search Button Clicked'); 1137 1138 $('.et_search_form_container').attr('style', 'z-index: 100 !important'); 1139 1140}); 1141 1142$(".et_close_search_field").click(function(){ 1143 console.log('Close Button Clicked'); 1144 setTimeout(function() { 1145 $('.et_search_form_container').attr('style', 'z-index: 50 !important'); 1146}, 1400); 1147}); 1148 1149})(jQuery) 1150 1151 1152jQuery(document).ready(function(){ 1153 jQuery('#fourth_content').click(function(){ 1154 var wdt=$(window).width(); 1155 if(wdt<991){ 1156 $('.et_search_outer').addClass('search_displayoff'); 1157 } 1158 1159 }) 1160 jQuery('.et_close_search_field').click(function(){ 1161 var wdt=$(window).width(); 1162 if(wdt<991){ 1163 $('.et_search_outer').removeClass('search_displayoff'); 1164 } 1165 1166 }) 1167})
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.