Site logo

Archived topic

drop-down menu speed

20 replies · Started by orlando britain on July 24, 2015

Viewing posts 1–15 of 21

hi,

on the main navigation bar I have drop down menus. There is a slight delay for the sub-menu to drop down when you hover over the menu item.

I want it to drop down immediately like it does in the mystile theme and other eCommerce stores.

I have tried changing this CSS transition code (all ease-in-out 0.2s) to below code, in the child theme but it didn't change the speed:

.main-navigation a {display: block;
text-decoration: none;
-webkit-transition:none !important ;
-moz-transition:none !important ;
-o-transition:none !important ;
transition: none !important ;

how would i go about doing this?

thanks

Are you trying to remove the delay, or the transition as a whole (so it just appears)?

hi tom,

I want it to drop down straight away when you hover over the link.

thanks,

orlando

thanks tom - I have copied taht code to bottom of footer.php and this got it how I want it.
cheers

Cool - make sure you're not altering core files, as you won't be able to update the theme without losing your modification.

Definitely better off using GP Hooks or a child theme :)

good point, have just moved the code to a GP hook instead of core.
works perfect still.
thanks :)

No problem :)

Hi, the last code isn't working for me, if I do this:

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

note the $ sign

it works but breaks the search and outputs some error in developer console, please help

The theme is no longer using superfish - I wrote my own script which is much more lightweight.

Now you can do something like this:

<script>
    jQuery( window ).load( function() {
        jQuery( '.sf-menu .menu-item-has-children' ).GenerateDropdownMenu.destroy();
        jQuery( '.sf-menu .menu-item-has-children' ).GenerateDropdownMenu({
                transition_speed: 0,
		open_delay: 0,
		close_delay: 0
        });
    });
</script>

Thank you Tom!

You're welcome :)

Hello Tom,
I want to get rid of the delay too, I added this code to the wp_footer hook and aktivated php but it didn't work. Where do I have to add the code to have my main Navigation without delay?

<script>
    jQuery( window ).load( function() {
        jQuery( '.sf-menu .menu-item-has-children' ).GenerateDropdownMenu.destroy();
        jQuery( '.sf-menu .menu-item-has-children' ).GenerateDropdownMenu({
                transition_speed: 0,
		open_delay: 0,
		close_delay: 0
        });
    });
</script>

No need to activate PHP for that one :)

Are you using the latest version of the theme?

Ok I deaktivaded php, that did not help.

I'm using GeneratePress 1.3.23

This archived topic is closed to new replies.