[Resolved] Disable Superfish Menu Fade / Slide / Transition

Home Forums Support [Resolved] Disable Superfish Menu Fade / Slide / Transition

Home Forums Support Disable Superfish Menu Fade / Slide / Transition

Viewing 15 posts - 1 through 15 (of 21 total)
  • Author
    Posts
  • #66917
    Webmaster

    I would like to make my primary nav instantly appear. I notice the superfish.js file, but I believe generatepress/js/scripts.js will be used instead. What do I need to change to get results?

    I found this post on the forums, but I wasn’t able to find the results.

    jQuery(document).ready(function($) {
    
    	$('.main-nav > ul').superfish({
    		delay:       0,                            // one second delay on mouseout
    		animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation
        disableHI:   true,
    		speed:       'fast'                          // faster animation speed
    	});
    	
    });

    Also, could I copy / paste code snippet to my child’s function.php file to prevent losing data on Theme upgrade?

    #67153
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    This code should work:

    add_action( 'wp_print_scripts', 'generate_remove_superfish', 100 );
    function generate_remove_superfish() {
    	wp_dequeue_script( 'superfish' );
    	wp_dequeue_script( 'hoverIntent' );
    	wp_dequeue_script( 'scripts' );
    }

    However, I just submitted GP 1.2.5 to WP.org, and I just found a mobile menu bug when Superfish is disabled.

    I’ve fixed the bug, but will wait to release 1.2.6 until I have a few more things done.

    If you want to email me at support@generatepress.com I can give you the bug fix, which will only be necessary while running 1.2.5.

    Let me know 🙂

    #67155
    Webmaster

    Thanks brothaman!

    I’ll go ahead an add that snippet to my child functions.php

    #67265
    Tom
    Lead Developer
    Lead Developer

    You’re welcome 🙂

    #116133
    Webmaster

    Hey Tom,

    What alternative method may I disable the animation from navigation? I’m using this theme on a WPMU and the subsite doesn’t give access to the functions.php.

    #116136
    Tom
    Lead Developer
    Lead Developer

    Hmm tough one, the transition is using javascript, so we can’t even overwrite it with custom CSS.

    The only way would be to dequeue superfish using a function – there’s no way for you to add PHP? Even using a plugin like Code Snippets?

    #116370
    Webmaster
    #116394
    Tom
    Lead Developer
    Lead Developer

    Do you have the code to dequeue it, or do you need it? 🙂

    #116424
    Webmaster

    May you please share code? Thanks in advance.

    #116456
    Tom
    Lead Developer
    Lead Developer

    Try adding this to the wp_footer hook:

    <script>
    	jQuery(document).ready(function() {
    		jQuery('ul.sf-menu').superfish('destroy');
    		jQuery('ul.sf-menu').superfish({
    			delay       : 0,
    			disableHI	: true,
    			animation   : { opacity: 'show' },
    			speed       : 1
    		});
    	});
    </script>
    #255267
    Marcelo

    Hi Tom, This do not work now, i need the same solution.

    #255269
    Tom
    Lead Developer
    Lead Developer
    #255416
    Marcelo

    Tom don´t work this other code neither.

    #255439
    Leo
    Staff
    Customer Support

    Try adding this CSS with the code Tom provided above:

    .sfHover > .sub-menu {
        opacity: 1 !important;
    }
    #255458
    Marcelo

    I want to change the menu speed not the opacity. I think that is an jQuery code.

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