No Code Attached Yet
avatar joomlafun
joomlafun
25 Mar 2025

Joomla 5, cassopiea template

Steps to reproduce the issue

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

Expected result

.active class to be added to the #contact menu item and to be removed from the "home" menu item

Actual result

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");
});
});
avatar joomlafun joomlafun - open - 25 Mar 2025
avatar joomla-cms-bot joomla-cms-bot - change - 25 Mar 2025
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 25 Mar 2025
avatar joomlafun joomlafun - change - 25 Mar 2025
The description was changed
avatar joomlafun joomlafun - edited - 25 Mar 2025

Add a Comment

Login with GitHub to post a comment