Skip to content

 

Menu becomes fixed when scrolling up


Description: 

Menu module in Beaver Builder with id=”submenu” and id=”submenu-medium”




Kind:

jQuery


Javascript:

jQuery(function($){
$(document).ready(function(a) {
function b() {
a("#submenu"), a(window).scrollTop() > 613 ? a("#submenu").css({
position: "fixed",
width: "100%",
"z-index": "1000",
top: "0px",
left: "0px"
}) : a("#submenu").css({
position: "relative",
width: "",
top: "auto",
"z-index": "0"
})
}
a(window).scroll("slow", b), b()
});
});

jQuery(function($){
$(document).ready(function(a) {
function b() {
a("#submenu-medium"), a(window).scrollTop() > 360 ? a("#submenu-medium").css({
position: "fixed",
width: "100%",
"z-index": "1000",
top: "0px",
left: "0px"
}) : a("#submenu-medium").css({
position: "relative",
widttion: "fixed",
width: "100%",
"z-index": "1000",
top: "0px",
left: "0px"
}) : a("#submenu-medium").css({
position: "relative",
width: ": "fixed",
width: "100%",
"z-index": "1000",
top: "0px",
left: "0px"
}) : a("#submenu-medium").css({
position: "relative",
width: " ",
top: "auto",
"z-index": "0"
})
}
a(window).scroll("slow", b), b()
});
});


URL: