- This topic has 20 replies, 4 voices, and was last updated 6 years, 4 months ago by Tom.
-
AuthorPosts
-
July 24, 2015 at 5:49 am #123274orlando britain
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
July 24, 2015 at 9:17 am #123316TomLead DeveloperLead DeveloperAre you trying to remove the delay, or the transition as a whole (so it just appears)?
July 24, 2015 at 9:35 am #123320orlando britainhi tom,
I want it to drop down straight away when you hover over the link.
thanks,
orlando
July 24, 2015 at 9:37 am #123321TomLead DeveloperLead DeveloperHarder than it should be – I need to add a hook or something.
Give this a try: http://generatepress.com/forums/topic/disable-superfish-menu-fade-slide-transition/#post-116456
July 24, 2015 at 11:29 am #123350orlando britainthanks tom – I have copied taht code to bottom of footer.php and this got it how I want it.
cheersJuly 24, 2015 at 12:49 pm #123363TomLead DeveloperLead DeveloperCool – 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 π
July 24, 2015 at 1:03 pm #123371orlando britaingood point, have just moved the code to a GP hook instead of core.
works perfect still.
thanks πJuly 24, 2015 at 1:23 pm #123373TomLead DeveloperLead DeveloperNo problem π
January 8, 2016 at 11:30 am #164346darutseHi, 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
January 8, 2016 at 11:41 am #164348TomLead DeveloperLead DeveloperThe 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>
January 8, 2016 at 11:48 am #164351darutseThank you Tom!
January 8, 2016 at 12:40 pm #164357TomLead DeveloperLead DeveloperYou’re welcome π
January 19, 2016 at 2:08 am #166625PatrickHello 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>
January 19, 2016 at 10:47 am #166718TomLead DeveloperLead DeveloperNo need to activate PHP for that one π
Are you using the latest version of the theme?
January 19, 2016 at 11:10 pm #166831PatrickOk I deaktivaded php, that did not help.
I’m using GeneratePress 1.3.23
-
AuthorPosts
- You must be logged in to reply to this topic.