[Support request] Custom icon for menu not working properly

Home Forums Support Custom icon for menu not working properly

  • This topic has 7 replies, 3 voices, and was last updated 6 months ago by Tom.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1128703
    jose

    I have an icon in the menu (added directly in wordpress menu title)

    <div id="nav-icon1">
      <span></span>
      <span></span>
      <span></span>
    </div>

    with

    $(document).ready(function(){
            $('#nav-icon1,#nav-icon2,#nav-icon3,#nav-icon4').click(function(){
                $(this).toggleClass('open');
            });
    });

    but doesnt work properly. When u click it transform to “X”, it should make the animation on click. But when you customize generatepress primary menu in “click – element”, the icon doesnt do nothing. “Open” should be added as a class in id=”nav-icon1″ div element, never happens.

    #1128717
    David
    Staff
    Customer Support

    Hi there,

    try replacing all $ with jQuery

    #1128957
    jose

    No not working, anyway the code its inside jQuery( function( $ ){};

    #1128959
    David
    Staff
    Customer Support

    This is out of our scope – but i am happy to take a look at the site if you can share a link ?

    #1128973
    jose

    Just i am working in local… 🙁

    Anyway, i have a child-theme, can i modify js/dropdown-click.js?

    After this,

    How can i do to stop calling the old js/dropdown-click.js in the parent theme and call the js/dropdown-click.js in the child theme.

    THX

    #1129283
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    You can add your own dropdown-click.js file to your child theme, and remove the old one like this:

    add_action( 'wp_enqueue_scripts', function() {
        wp_dequeue_script( 'generate-dropdown-click' );
    } );

    Let me know if you need more info 🙂

    #1129392
    jose

    I tried but generatepress stil load the js (/js/dropdown-click.min.js v2.4.1)

    I tried wp_dequeue_script( ‘generate-dropdown-click’ ); just above the 5x wp_enqueue_script that i have registered.

    #1129896
    Tom
    Lead Developer
    Lead Developer

    Can you share your full wp_enqueue_scripts function with me?

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.