Hello we would love to show a navigation bar on our landing page but only when people scroll down the page…
So far I tried:
$(function(){
$(window).scroll(function(){
if($(this).scrollTop() \> 560){
var boxToAppend = '#lp-pom-box-348';
var boxParent = $(boxToAppend).parent();
$(boxToAppend).clone().appendTo(boxParent).css({"position":"fixed", "left":"0", "top":"0", "width":"100%", "z-index":"100"}).children().remove();
$(boxToAppend).css({"position":"fixed", "left":"auto", "top":"0px", "width":"100%", "z-index":"200", "border-style":"none none none none", "border-width":"0px", "background":"none"});
}else if($(this).scrollTop() \<= $('#header').offset().top){
var boxToAppend = '#lp-pom-box-348';
var boxParent = $(boxToAppend).parent();
$(boxToAppend).clone().appendTo(boxParent).css({"display":"none", "position":"fixed", "left":"0", "top":"0", "width":"100%", "z-index":"100"}).children().remove();
$(boxToAppend).css({"display":"none", "position":"fixed", "left":"auto", "top":"-70px", "width":"100%", "z-index":"200", "border-style":"none none none none", "border-width":"0px", "background":"none"});
}
});
});
But it did not work…
Many thanks for any input…
Best regards
B