Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

Elementor Hide Sticky Header on Scroll Down - Show on Scroll Up

<script>

document.addEventListener('DOMContentLoaded', function() {
jQuery(function($) {
var mywindow = $(window);
var mypos = mywindow.scrollTop();
let scrolling = false; /* For throlling scroll event */
window.addEventListener('scroll', function() {
scrolling = true;
});
setInterval(() => {
if (scrolling) {
scrolling = false;
if (mypos > 40) {
if (mywindow.scrollTop() > mypos) {
$('#stickyheaders').addClass('headerup');
} else {
$('#stickyheaders').removeClass('headerup');
}
}
mypos = mywindow.scrollTop();
}
}, 300);
});
});

</script>
<style>
#stickyheaders{
transition : transform 0.34s ease;
}
.headerup{
transform: translateY(-110px); /*adjust this value to the height of your header*/
}
</style>
Comment

PREVIOUS NEXT
Code Example
Javascript :: link change page react 
Javascript :: phaser place items on circle reverse 
Javascript :: phaser place on triangle 
Javascript :: phaser rotate container facing point 
Javascript :: phaser animation get progress 
Javascript :: phaser hide animation on complete 
Javascript :: phaser remove animation event 
Javascript :: append input using js 
Javascript :: scrolling text animation javascript 
Javascript :: remove text in div JQuery zqqqqqqqqqqqqqqqzzzzzzzzzzzzzzzzzzzzzzzzzzzzzqqqqqqqqqqqqqqqqqq 
Javascript :: chai promise resolved 
Javascript :: using lambda for elasticache node.js 
Javascript :: navbar permanently in react router dom v6 
Javascript :: smembers in redis 
Javascript :: offline bot command discord.js 
Javascript :: learn javascript 
Javascript :: convert json to csv npm 
Javascript :: brightness javascript 
Javascript :: javascript this = that 
Javascript :: what is closures in javascript 
Javascript :: javascript practice questions 
Javascript :: in javascript pass infinite argument in function 
Javascript :: turn string into number javascript 
Javascript :: firebase realtime database increment value 
Javascript :: show uploaded image in react/nextjs 
Javascript :: simulate mouse click javascript 
Javascript :: scarping js 
Javascript :: javascript code checker 
Javascript :: javascript xmlhttprequest 
Javascript :: how to add a function in javascript 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =