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
Attachments
Sticky menu.jpg (23.14 KiB) Viewed 795 times
viewtopic.php?t=206927
LE: Install this extension (to edit ocmod files)
https://www.opencart.com/index.php?rout ... n_id=22318
And changes from converted ocmod (top link) and change <body class="{{ class }}"> to <body>
LE: Install this extension (to edit ocmod files)
https://www.opencart.com/index.php?rout ... n_id=22318
And changes from converted ocmod (top link) and change <body class="{{ class }}"> to <body>
Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer
Hello
I installed the module
https://www.opencart.com/index.php?rout ... PWMYfQL9Y3
Error
http://prntscr.com/m0nj3x
I installed the module
https://www.opencart.com/index.php?rout ... PWMYfQL9Y3
Error
http://prntscr.com/m0nj3x
Because you don't have installed from Extensions->Modules....
Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer
I installed the module
But the module does not go with the fixed header menu
This javascript code works
viewtopic.php?t=203250
but you also need to add the top part
Maybe someone knows what to add to the javascript code to work with the header
Thank you
But the module does not go with the fixed header menu
This javascript code works
viewtopic.php?t=203250
but you also need to add the top part
Maybe someone knows what to add to the javascript code to work with the header
Thank you
Converted extension work just fine on that theme with default menu.
And because Mega Menu is a paid module that converted extension can't be tested
And because Mega Menu is a paid module that converted extension can't be tested
Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer
Hello
Now it works with my menu
http://prntscr.com/m12e1d
I deleted a bracket and it does not work
Thanks for your help
Happy New Year
Now it works with my menu
http://prntscr.com/m12e1d
I deleted a bracket and it does not work
Thanks for your help
Happy New Year
Who is online
Users browsing this forum: Semrush [Bot] and 13 guests