Advanced AJAX Page Loader
Click Code not working correctly (1 post)

  1. MaxWendkos
    Posted 2 years ago #

    Hi, I'm having an issue getting the Click Code to function correctly. The .current-menu-item class isn't applied to the link I clicked until after the AJAX has finished loading, which leaves a few seconds in which no link is identified as the current one. I'd like to correct this so that the .current-menu-item class is applied to the new link element as soon as it's clicked.

    This is the code that I currently have:

    // highlight the current menu item
    jQuery('.main-nav-item').each(function() {
    jQuery('.main-nav-item').each(function() {

    The first two parts (which I'm just now noticing are identical?) seem to be working correctly - the .current-menu-item class is being removed from the other elements when I click on the new one. However, I need the .current-menu-item class to be applied to the clicked link the second it's clicked.

    Thanks in advance for your assistance!


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Advanced AJAX Page Loader
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.