Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    May 2009
    Thanked 1 Time in 1 Post

    Adding additional class

    Hi, I am using the JQuery one page nav plugin. If the current menu item is active, the plugin adds a class called current. I need to add a new class alongside this, how would I go about doing this? I have looked at the plugin code and I know how to replace the current class, but not to sure how to add to it. I was hoping there was a way to add some of my own code which looks for the current class, and if it finds it, adds an additional class next to it.

    Would this be possible?


  2. #2
    Regular Coder Strider64's Avatar
    Join Date
    Dec 2011
    Thanked 33 Times in 33 Posts
    However, the active html menu tag is identified (I'm guessing it has a class called 'active').

    and if you want to add code to something that has a class:

    if $('div').hasClass('current') {
       // Add New Code Here:
    Last edited by Strider64; 05-24-2014 at 02:23 PM.
    "A person who never made a mistake never tried anything new." ~ Albert Einstein https://www.pepster.com


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts