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