Joomla 5, cassopiea template
1° Create a menu item and select url as its option. Add a for example #contact as the url name
2° Click on your menu item and it will scroll to the #contact section of the page
.active class to be added to the #contact menu item and to be removed from the "home" menu item
On click :
.active class will stick to the home menu and is not applied
On scroll : it is the same
Temporary solution but does it does not apply on scroll so it means that the module menu cannot be used for a One page website even if joomla menu items allow to use links that scroll to #section IDs
$('.mainmenumodule li:has(> a)').click(function() {
$('.mainmenumodule li:has(> a)').removeClass('active');
$(this).addClass("active");
});
});
Labels |
Added:
No Code Attached Yet
|