Add an active class: better with JQuery or CSS?
#1 17-10-2015 
Hi Lee,

For the performance, browser compatibility etc is better use JQuery or CSS to add an active class to a menu?

For CSS, add to each page body id=#nameid, to each item of the menu class="name" and then in CSS add the style (#nameid .nameclass etc).

For JQuery add always class to each item and then in each page:

$(document).ready(function () {

And there is a script to do it automatically? For not edit each nav usercp of the pages.

Thank you

#2 18-10-2015 
I dunno Deb, is this JUST for the usercp nav? Usually I would not advise using jquery to change a class like that.

#3 18-10-2015 
Ok, added CSS, easy and fast (more or less) Confused

Finished usercp too Big Grin

#4 18-10-2015 
That was quick Deb Smile

#5 18-10-2015 
For usercp only added menu in usercp_nav and for each item I added the class to links. Then in each page I edited only changed body in body id="name" and added in CSS the code like "body#userforums .userforums"

For each page of usercp only added legend strong, added class btn to buttons and used many <dl> <dt><dd> Big Grin

And copied-pasted for each template the toggle nav thing.


Sorry, that is a members only option