Archived topic
Disable Superfish Menu Fade / Slide / Transition
20 replies · Started by Webmaster on January 20, 2015
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?
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 :)
Thanks brothaman!
I'll go ahead an add that snippet to my child functions.php
You're welcome :)
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.
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?
That'll work - thanks!
Do you have the code to dequeue it, or do you need it? :)
May you please share code? Thanks in advance.
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>
Hi Tom, This do not work now, i need the same solution.
This should do it: https://generatepress.com/forums/topic/hover-time-dropdown/#post-219409
Tom don´t work this other code neither.
Try adding this CSS with the code Tom provided above:
.sfHover > .sub-menu {
opacity: 1 !important;
}
I want to change the menu speed not the opacity. I think that is an jQuery code.