Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

1 function

fusionDisableStickyHeader(){jQuery(window).off(".stickyheader"),jQuery(".fusion-header-wr
apper, .fusion-header-sticky-height, .fusion-header, .fusion-logo,
.fusion-header-wrapper .fusion-main-menu > li a, .fusion-header-wrapper
.fusion-secondary-main-menu").attr("style",""),jQuery(".fusion-is-sticky").removeClass("f
usion-is-sticky")}function fusionInitStickyHeader(){var
e,i,r,a,o,d,n,t=300,s=0;avadaHeaderVars.sticky_header_shrinkage||(t=0),e=jQuery(".fusion-
header").parent(),window.$headerParentHeight=e.outerHeight(),window.$headerHeight=jQuery(
".fusion-header").outerHeight(),i=parseInt(avadaHeaderVars.nav_height,10),window.$menuHei
ght=i,window.$scrolled_header_height=65,r=jQuery(".fusion-logo
img:visible").length?jQuery(".fusion-logo
img:visible"):"",a=!1,window.$stickyTrigger=jQuery(".fusion-header"),window.$wpadminbarHe
ight=jQuery("#wpadminbar").length?jQuery("#wpadminbar").height():0,window.$stickyTrigger_
position=window.$stickyTrigger.length?Math.round(window.$stickyTrigger.offset().top)-wind
ow.$wpadminbarHeight-window.$woo_store_notice-window.$top_frame:0,window.$woo_store_notic
e=jQuery(".woocommerce-store-notice").length&&jQuery(".woocommerce-store-notice").is(":vi
sible")?jQuery(".woocommerce-store-notice").outerHeight():0,window.$top_frame=jQuery(".fu
sion-top-frame").is(":visible")?jQuery(".fusion-top-frame").outerHeight()-window.$woo_sto
re_notice:0,window.sticky_header_type=1,window.$slider_offset=0,window.$site_width=jQuery
("#wrapper").outerWidth(),window.$media_query_test_1=Modernizr.mq("only screen and
(min-device-width: 768px) and (max-device-width: 1366px) and (orientation:
portrait)")||Modernizr.mq("only screen and (min-device-width: 768px) and
(max-device-width: 1024px) and (orientation:
landscape)"),window.$media_query_test_2=Modernizr.mq("screen and (max-width:
"+avadaHeaderVars.side_header_break_point+"px)"),window.$media_query_test_3=Modernizr.mq(
"screen and (max-width:
"+avadaHeaderVars.side_header_break_point+"px)"),window.$media_query_test_4=Modernizr.mq(
"only screen and (max-width:
"+avadaHeaderVars.side_header_break_point+"px)"),window.$standardLogoHeight=jQuery(".fusi
on-standard-logo").height(),window.$logoMarginTop=""!==jQuery(".fusion-logo").data("margi
n-top")?parseInt(jQuery(".fusion-logo").data("margin-top"),10):0,window.$logoMarginBottom
=""!==jQuery(".fusion-logo").data("margin-bottom")?parseInt(jQuery(".fusion-logo").data("
margin-bottom"),10):0,window.$standardLogoHeight+=window.$logoMarginTop+window.$logoMargi
nBottom,window.$initial_desktop_header_height=Math.max(window.$headerHeight,Math.round(Ma
th.max(window.$menuHeight,window.$standardLogoHeight)+parseFloat(jQuery(".fusion-header")
.find(".fusion-row").css("padding-top"))+parseFloat(jQuery(".fusion-header").find(".fusio
n-row").css("padding-bottom")))),window.$initial_sticky_header_shrinkage=avadaHeaderVars.
sticky_header_shrinkage,window.$sticky_can_be_shrinked=!0,avadaHeaderVars.sticky_header_s
hrinkage||(t=0,window.$scrolled_header_height=window.$headerHeight),window.original_logo_
height=0,""!==r&&(r[0].hasAttribute("data-retina_logo_url")?((o=new
Image).src=r.attr("data-retina_logo_url"),window.original_logo_height=parseInt(r.height()
,10)+parseInt(avadaHeaderVars.logo_margin_top,10)+parseInt(avadaHeaderVars.logo_margin_bo
ttom,10)):((o=new
Image).src=r.attr("src"),window.original_logo_height=parseInt(o.naturalHeight,10)+parseIn
t(avadaHeaderVars.logo_margin_top,10)+parseInt(avadaHeaderVars.logo_margin_bottom,10))),(
1<=jQuery(".fusion-header-v4").length||1<=jQuery(".fusion-header-v5").length)&&(window.st
icky_header_type=2,"menu_and_logo"===avadaHeaderVars.header_sticky_type2_layout||Moderniz
r.mq("only screen and (max-width:
"+avadaHeaderVars.side_header_break_point+"px)")&&"modern"===avadaHeaderVars.mobile_menu_
design?window.$stickyTrigger=jQuery(".fusion-sticky-header-wrapper"):window.$stickyTrigge
r=jQuery(".fusion-secondary-main-menu"),window.$stickyTrigger_position=Math.round(window.
$stickyTrigger.offset().top)-window.$wpadminbarHeight-window.$woo_store_notice-window.$to
p_frame),1===window.sticky_header_type?Modernizr.mq("only screen and (max-width:
"+avadaHeaderVars.side_header_break_point+"px)")?window.$scrolled_header_height=window.$h
eaderHeight:window.$original_sticky_trigger_height=jQuery(window.$stickyTrigger).outerHei
ght():2===window.sticky_header_type&&("classic"===avadaHeaderVars.mobile_menu_design&&jQu
ery(e).height(window.$headerParentHeight),Modernizr.mq("only screen and (max-width:
"+avadaHeaderVars.side_header_break_point+"px)")?window.$scrolled_header_height=window.$h
eaderParentHeight:jQuery(e).height(window.$headerParentHeight)),1<=jQuery("#side-header")
.length&&(window.sticky_header_type=3),jQuery(".fusion-secondary-header").length&&(s=jQue
ry(".fusion-secondary-header").outerHeight()),jQuery(document).height()-(window.$initial_
desktop_header_height+s+window.$wpadminbarHeight-window.$scrolled_header_height)<jQuery(w
indow).height()&&avadaHeaderVars.sticky_header_shrinkage?(window.$sticky_can_be_shrinked=
!1,jQuery(".fusion-header-wrapper").removeClass("fusion-is-sticky")):window.$sticky_can_b
e_shrinked=!0,d=jQuery(window).width(),n=jQuery(window).height(),jQuery(window).on("resiz
e.stickyheader",function(){var
a,o,h,u,w,y;window.$media_query_test_1=Modernizr.mq("only screen and (min-device-width:
768px) and (max-device-width: 1366px) and (orientation: portrait)")||Modernizr.mq("only
screen and (min-device-width: 768px) and (max-device-width: 1024px) and (orientation:
landscape)"),window.$media_query_test_2=Modernizr.mq("screen and (max-width:
"+avadaHeaderVars.side_header_break_point+"px)"),window.$media_query_test_3=Modernizr.mq(
"screen and (max-width:
"+avadaHeaderVars.side_header_break_point+"px)"),window.$media_query_test_4=Modernizr.mq(
"only screen and (max-width:
"+avadaHeaderVars.side_header_break_point+"px)"),!Modernizr.mq("only screen and
(min-width:
"+avadaHeaderVars.side_header_break_point+"px)")||-1===avadaHeaderVars.header_padding_top
.indexOf("%")&&-1===avadaHeaderVars.header_padding_bottom.indexOf("%")||jQuery(".fusion-i
s-sticky").length||(window.$headerHeight=Math.round(Math.max(window.$menuHeight,window.$s
tandardLogoHeight)+parseFloat(jQuery(".fusion-header").find(".fusion-row").css("padding-t
op"))+parseFloat(jQuery(".fusion-header").find(".fusion-row").css("padding-bottom"))),jQu
ery(".fusion-header,
.fusion-header-sticky-height").height(window.$headerHeight),avadaHeaderVars.sticky_header
_shrinkage||(window.$scrolled_header_height=window.$headerHeight)),(-1!==avadaHeaderVars.
header_padding_top.indexOf("%")||-1!==avadaHeaderVars.header_padding_bottom.indexOf("%")&
&!jQuery(".fusion-is-sticky").length)&&(window.$initial_desktop_header_height=Math.max(wi
ndow.$headerHeight,Math.round(Math.max(window.$menuHeight,window.$standardLogoHeight)+par
seFloat(jQuery(".fusion-header").find(".fusion-row").css("padding-top"))+parseFloat(jQuer
y(".fusion-header").find(".fusion-row").css("padding-bottom"))))),!avadaHeaderVars.header
_sticky_tablet&&window.$media_query_test_1?(jQuery(".fusion-header-wrapper,
.fusion-header-sticky-height, .fusion-header, .fusion-logo, .fusion-header-wrapper
.fusion-main-menu > li a, .fusion-header-wrapper
.fusion-secondary-main-menu").attr("style",""),jQuery(".fusion-header-wrapper").removeCla
ss("fusion-is-sticky")):avadaHeaderVars.header_sticky_tablet&&window.$media_query_test_1&
&(t=0),avadaHeaderVars.header_sticky_mobile||!window.$media_query_test_2||window.$media_q
uery_test_1?avadaHeaderVars.header_sticky_mobile&&window.$media_query_test_2&&!window.$me
dia_query_test_1&&(t=0):(jQuery(".fusion-header-wrapper, .fusion-header-sticky-height,
.fusion-header, .fusion-logo, .fusion-header-wrapper .fusion-main-menu > li a,
.fusion-header-wrapper
.fusion-secondary-main-menu").attr("style",""),jQuery(".fusion-header-wrapper").removeCla
ss("fusion-is-sticky")),(jQuery("body").hasClass("fusion-builder-live")||d&&n&&(jQuery(wi
ndow).width()!==d||jQuery(window).height()!==n))&&(i=parseInt(avadaHeaderVars.nav_height,
10),jQuery("#wpadminbar").length?window.$wpadminbarHeight=jQuery("#wpadminbar").height():
window.$wpadminbarHeight=0,window.$woo_store_notice=jQuery(".woocommerce-store-notice").l
ength&&jQuery(".woocommerce-store-notice").is(":visible")?jQuery(".woocommerce-store-noti
ce").outerHeight():0,jQuery(".fusion-is-sticky").length&&(a=jQuery(".fusion-header"),2===
window.sticky_header_type&&(a="menu_only"!==avadaHeaderVars.header_sticky_type2_layout||"
classic"!==avadaHeaderVars.mobile_menu_design&&window.$media_query_test_4?jQuery(".fusion
-sticky-header-wrapper"):jQuery(".fusion-secondary-main-menu")),jQuery("#wpadminbar").len
gth&&(jQuery(".fusion-header, .fusion-sticky-header-wrapper,
.fusion-secondary-main-menu").css("top",""),jQuery(a).css("top",window.$wpadminbarHeight+
window.$woo_store_notice+window.$top_frame)),"boxed"===avadaHeaderVars.layout_mode.toLowe
rCase()&&jQuery(a).css("max-width",jQuery("#wrapper").outerWidth()+"px")),1===window.stic
ky_header_type&&(avadaHeaderVars.sticky_header_shrinkage=window.$initial_sticky_header_sh
rinkage,jQuery(".fusion-header-wrapper").hasClass("fusion-is-sticky")||(jQuery(".fusion-s
econdary-header").length?window.$stickyTrigger_position=Math.round(jQuery(".fusion-second
ary-header").offset().top)-window.$wpadminbarHeight-window.$woo_store_notice-window.$top_
frame+jQuery(".fusion-secondary-header").outerHeight():window.$stickyTrigger_position=Mat
h.round(jQuery(".fusion-header").offset().top)-window.$wpadminbarHeight-window.$woo_store
_notice-window.$top_frame),Modernizr.mq("only screen and (max-width:
"+avadaHeaderVars.side_header_break_point+"px)")||(o=jQuery(".fusion-logo
img:visible").length?jQuery(".fusion-logo
img:visible").outerHeight()+parseInt(avadaHeaderVars.logo_margin_top,10)+parseInt(avadaHe
aderVars.logo_margin_bottom,10):0,h=0,jQuery(".fusion-main-menu > ul >
li").each(function(){h+=jQuery(this).outerWidth()}),jQuery(".fusion-header-v6").length&&(
h=0),jQuery(".fusion-is-sticky").length?(h>jQuery(".fusion-header
.fusion-row").width()-jQuery(".fusion-logo
img:visible").outerWidth()?(window.$headerHeight=jQuery(".fusion-main-menu").outerHeight(
)+o,jQuery(".fusion-header-v7").length&&(window.$headerHeight=jQuery(".fusion-middle-logo
-menu").height()),(jQuery(".fusion-header-v2").length||jQuery(".fusion-header-v3").length
)&&(window.$headerHeight+=1)):avadaHeaderVars.sticky_header_shrinkage?window.$headerHeigh
t=65:(window.original_logo_height>i?window.$headerHeight=window.original_logo_height:wind
ow.$headerHeight=i,window.$headerHeight+=parseFloat(jQuery(".fusion-header >
.fusion-row").css("padding-top"))+parseFloat(jQuery(".fusion-header >
.fusion-row").css("padding-bottom")),window.$headerHeight=Math.round(window.$headerHeight
),(jQuery(".fusion-header-v2").length||jQuery(".fusion-header-v3").length)&&(window.$head
erHeight+=1)),window.$scrolled_header_height=window.$headerHeight,jQuery(".fusion-header-
sticky-height").css("height",window.$headerHeight),jQuery(".fusion-header").css("height",
-10?y=(window.$scrolled_header_height-w)/2:(w=window.$scrolled_header_height-10,y=5),r.st
op(!0,!0).animate({height:w},{queue:!1,duration:t,easing:"easeOutCubic",complete:function
(){jQuery(this).css("display","")},step:function(){jQuery(this).css("display","")}})),jQu
ery(".fusion-logo").stop(!0,!0).animate({"margin-top":y,"margin-bottom":y},{queue:!1,dura
tion:t,easing:"easeOutCubic"}),jQuery(".fusion-header-v6").length||jQuery(".fusion-main-m
enu > ul > li").not(".fusion-middle-logo-menu-logo").find(">
a").stop(!0,!0).animate({height:window.$scrolled_header_height},{queue:!1,duration:t,easi
ng:"easeOutCubic"}))))),d=jQuery(window).width(),n=jQuery(window).height())}),jQuery(wind
ow).on("scroll.stickyheader",function(){var
e,o;if(window.$sticky_can_be_shrinked){if(!avadaHeaderVars.header_sticky_tablet&&window.$
media_query_test_1)return;if(avadaHeaderVars.header_sticky_tablet&&window.$media_query_te
st_1&&(t=0),!avadaHeaderVars.header_sticky_mobile&&window.$media_query_test_2&&!window.$m
edia_query_test_1)return;if(avadaHeaderVars.header_sticky_mobile&&window.$media_query_tes
t_2&&(t=0),3===window.sticky_header_type&&!avadaHeaderVars.header_sticky_mobile)return;if
(3===window.sticky_header_type&&!avadaHeaderVars.header_sticky_mobile&&!window.$media_que
ry_test_3)return;0===jQuery(".fusion-is-sticky").length&&jQuery(".fusion-header,
.fusion-secondary-main-menu, #side-header").find(".fusion-mobile-nav-holder >
ul").is(":visible")&&(jQuery(".fusion-header-has-flyout-menu-content").length?window.$sti
ckyTrigger_position=Math.round(jQuery(".fusion-header, .fusion-sticky-header-wrapper,
#side-header").find(".fusion-header-has-flyout-menu-content").offset().top)-window.$wpadm
inbarHeight-window.$woo_store_notice-window.$top_frame:window.$stickyTrigger_position=Mat
h.round(jQuery(".fusion-header, .fusion-sticky-header-wrapper,
#side-header").find(".fusion-mobile-nav-holder:visible").offset().top)-window.$wpadminbar
Height-window.$woo_store_notice-window.$top_frame+jQuery(".fusion-header,
.fusion-sticky-header-wrapper,
#side-header").find(".fusion-mobile-nav-holder:visible").height()),3!==window.sticky_head
er_type&&0===jQuery(".fusion-is-sticky").length&&!jQuery(".fusion-header,
.fusion-secondary-main-menu").find(".fusion-mobile-nav-holder >
ul").is(":visible")&&jQuery(".fusion-header").length&&(window.$stickyTrigger=jQuery(".fus
ion-header"),window.$stickyTrigger_position=Math.round(window.$stickyTrigger.offset().top
)-window.$wpadminbarHeight-window.$woo_store_notice-window.$top_frame,2===window.sticky_h
eader_type&&("menu_and_logo"===avadaHeaderVars.header_sticky_type2_layout||window.$media_
query_test_4&&"modern"===avadaHeaderVars.mobile_menu_design?window.$stickyTrigger=jQuery(
".fusion-sticky-header-wrapper"):window.$stickyTrigger=jQuery(".fusion-secondary-main-men
u"),window.$stickyTrigger_position=Math.round(window.$stickyTrigger.offset().top)-window.
$wpadminbarHeight-window.$woo_store_notice-window.$top_frame),"modern"!==avadaHeaderVars.
mobile_menu_design||2!==window.sticky_header_type||!window.$media_query_test_4&&"menu_and
_logo"!==avadaHeaderVars.header_sticky_type2_layout||(window.$headerHeight=jQuery(window.
$stickyTrigger).outerHeight(),window.$scrolled_header_height=window.$headerHeight,jQuery(
".fusion-header-sticky-height").css("height",window.$scrolled_header_height))),3!==window
.sticky_header_type||0!==jQuery(".fusion-is-sticky").length||jQuery("#side-header").find(
".fusion-mobile-nav-holder >
ul").is(":visible")||(window.$stickyTrigger=jQuery("#side-header"),window.$stickyTrigger_
position=Math.round(window.$stickyTrigger.offset().top)-window.$wpadminbarHeight-window.$
woo_store_notice-window.$top_frame),jQuery(window).scrollTop()>window.$stickyTrigger_posi
tion?!1===a&&(window.$woo_store_notice=jQuery(".woocommerce-store-notice").length&&jQuery
(".woocommerce-store-notice").is(":visible")?jQuery(".woocommerce-store-notice").outerHei
ght():0,jQuery(".fusion-header-wrapper").addClass("fusion-is-sticky"),"function"==typeof
resizeOverlaySearch&&resizeOverlaySearch(),jQuery(window.$stickyTrigger).css("top",window
.$wpadminbarHeight+window.$woo_store_notice+window.$top_frame),r=jQuery(".fusion-logo
img:visible"),"modern"===avadaHeaderVars.mobile_menu_design?(jQuery(".fusion-header,
.fusion-secondary-main-menu,
#side-header").find(".fusion-mobile-nav-holder").hide(),jQuery(".fusion-secondary-main-me
nu .fusion-main-menu-search
.fusion-custom-menu-item-contents").hide(),jQuery(".fusion-mobile-menu-search").hide()):"
classic"===avadaHeaderVars.mobile_menu_design&&(jQuery(".fusion-header,
.fusion-secondary-main-menu, #side-header").find(".fusion-mobile-nav-holder >
ul").hide(),jQuery(".fusion-mobile-menu-search").hide()),"modern"===avadaHeaderVars.mobil
e_menu_design&&1<=jQuery(".fusion-is-sticky").length&&1<=jQuery(".fusion-mobile-sticky-na
v-holder").length&&jQuery(".fusion-mobile-nav-holder").is(":visible")&&jQuery(".fusion-mo
bile-nav-holder").not(".fusion-mobile-sticky-nav-holder").hide(),"boxed"===avadaHeaderVar
s.layout_mode.toLowerCase()&&jQuery(window.$stickyTrigger).css("max-width",jQuery("#wrapp
er").outerWidth()),1===window.sticky_header_type&&(Modernizr.mq("only screen and
(max-width:
"+avadaHeaderVars.side_header_break_point+"px)")?jQuery(".fusion-header-sticky-height").c
ss("height",window.$scrolled_header_height):parseInt(window.$headerHeight,10)===parseInt(
window.$initial_desktop_header_height,10)&&(jQuery(window.$stickyTrigger).stop(!0,!0).ani
mate({height:window.$scrolled_header_height},{queue:!1,duration:t,easing:"easeOutCubic",c
omplete:function(){jQuery(this).css("overflow","visible")}}),jQuery(".fusion-header-stick

You might also like