Sticky menu with checkout and my account
Posted: Fri Dec 28, 2018 10:03 pm
Hello everyone
What do I have to add to this code?
sticky menu and stay on top with the search button and shopping cart
The cod is
$(function(){
var div = '#m-menu';
var windowScrollTop = $(window).scrollTop();
var divOffsetTop = $(div).offset().top;
if(windowScrollTop > divOffsetTop){
$(div).addClass('sticky');
} else {
$(div).removeClass('sticky');
}
$(window).on('scroll', function(){
var windowScrollTop = $(window).scrollTop();
if(windowScrollTop > divOffsetTop){
$(div).addClass('sticky');
} else {
$(div).removeClass('sticky');
}
});
});
And Css code
#m-menu.sticky {
position: fixed;
left: 0;
right: 0;
top: 0;
z-index: 999999;
}
I use this menu module
https://www.opencart.com/index.php?rout ... ega%20menu
So I want to show the sticky menu
http://prntscr.com/m0mcxl
The theme http://www.spearthemes.com/oc-light/
Opencart 3.0.2.0
Now it just works like this
http://prntscr.com/m0mekz
If it can be done sticky menu with header
Thank you
What do I have to add to this code?
sticky menu and stay on top with the search button and shopping cart
The cod is
$(function(){
var div = '#m-menu';
var windowScrollTop = $(window).scrollTop();
var divOffsetTop = $(div).offset().top;
if(windowScrollTop > divOffsetTop){
$(div).addClass('sticky');
} else {
$(div).removeClass('sticky');
}
$(window).on('scroll', function(){
var windowScrollTop = $(window).scrollTop();
if(windowScrollTop > divOffsetTop){
$(div).addClass('sticky');
} else {
$(div).removeClass('sticky');
}
});
});
And Css code
#m-menu.sticky {
position: fixed;
left: 0;
right: 0;
top: 0;
z-index: 999999;
}
I use this menu module
https://www.opencart.com/index.php?rout ... ega%20menu
So I want to show the sticky menu
http://prntscr.com/m0mcxl
The theme http://www.spearthemes.com/oc-light/
Opencart 3.0.2.0
Now it just works like this
http://prntscr.com/m0mekz
If it can be done sticky menu with header
Thank you