Hello again @gvectors-team,
I have three the same scripts (on 3 different classes) and i don’t know what may be the reason why they don’t interact with the forum, please help me.
Scripts are inside header on all wordpress pages.
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript">
// basket on scroll
var didScroll;
var lastScrollTop = 0;
var delta = 5;
var navbarHeight = $('.xoo-wsc-basket').outerHeight();
$(window).scroll(function(event){
didScroll = true;
});
setInterval(function() {
if (didScroll) {
hasScrolled();
didScroll = false;
}
}, 250);
function hasScrolled() {
var st = $(this).scrollTop();
// Make sure they scroll more than delta
if(Math.abs(lastScrollTop - st) <= delta)
return;
// If they scrolled down and are past the navbar, add class .nav-up.
// This is necessary so you never see what is "behind" the navbar.
if (st > lastScrollTop && st > navbarHeight){
// Scroll Down
$('.xoo-wsc-basket').removeClass('.xoo-wsc-basket').addClass('basket-nav-up');
} else {
// Scroll Up
if(st + $(window).height() < $(document).height()) {
$('.xoo-wsc-basket').removeClass('basket-nav-up').addClass('.xoo-wsc-basket');
}
}
lastScrollTop = st;
}
</script>
-
This reply was modified 5 years, 2 months ago by
xszejdi.