Tagged: ,

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #291291

    Hello,

    Now all submenu’s are displayed when the cursor hovers on the top-menu/parent.
    I want to show the submenu only when submenu parent is clicked.
    http://test.contrario.nl
    Is there a css code that results in this behavior?
    The reason is that our users don’t expect that the top-menu-items also are page’s and not a title for the submenu.

    Any suggestions?

    Thank you!

    Alfred

    #291367

    Hi alfredscholten!

    Thank you for using the theme.

    Edit js > avia.js, find this code on line 1063:

    currentLink.bind('mouseenter', function()
    					{
    						sublist.stop().css({visibility:'visible'}).animate({opacity:1});
    					});

    Replace it with:

    currentLink.bind('click', function()
    					{
    						event.preventDefault()
    						sublist.stop().css({visibility:'visible'}).animate({opacity:1});
    					});

    Cheers!
    Ismael

    #291876

    Hi Ismael!

    Thanks for the code.
    This works fine, but… now the link to the page of the top-menu doesn’t open.

    Is there an other way? So that the top-menu-page will load/open and the submenu’s only shows when this page is loaded?

    Regards,

    Alfred

    #291893

    Hello Alfred!

    That’s possible but it would require a heavy customization to the theme, that’s beyond the scope of the support we can offer.

    Alternatively, you can use a plugin like this to make the menus appear conditionally (different menus per page).

    Cheers!
    Josue

    #393469

    Gday all

    I found that when I used the code supplied by Ismael, the parent click did actually open the parent page (while simultaneously revealing the submenu on same click).

    I’d like the click to disable the parent page from opening, so only the submenu items can be revealed and chosen.

    Does anyone know an additional line to achieve that? That is, to disable the parent page from opening? I tried using a ‘Link’ with # for the url but then the click didn’t reveal the submenu.

    Thanks for any help you are able to give me.

    cheers

    Darryl

    #393482

    Hi Darryl,

    I tried using a ‘Link’ with # for the url but then the click didn’t reveal the submenu.

    This normally works, can you please create us a WordPress administrator account? post it here as a private reply.

    Regards,
    Josue

    #393488
    This reply has been marked as private.
    #393530

    Hi Darryl!

    I tested it a few times and the submenu shows when the “About us toggle submenu test” item is clicked – http://screencast.com/t/TJlBPceZwAy

    Best regards,
    Josue

    #393536

    Ah, that’s fascinating Josue. I didn’t check other browsers and this has reminded me to do so. I’m on a MacBook, Firefox latest version (35.0.1) and it doesn’t work. Though Safari and Chrome do. Does that mean Firefox may need additional js that functionally does the same thing?

    Edit: I just read some info on a Mozilla forum that might help: ” going to the top of the page is what href=”#” is supposed to do. If you have a JavaScript event and want to suppress the other link action, use “return false” at the end of it.”

    Does that make sense to you Josue? I don’t know how to do javascript, so I’m not sure how to test it.

    cheers
    Darryl

    • This reply was modified 9 years, 10 months ago by itchybrain.
    #394954

    Hi!

    Try to use this code instead:

    currentLink.bind('click', function(event)
    					{
    						event.preventDefault()
    						sublist.stop().css({visibility:'visible'}).animate({opacity:1});
    					});

    Remove browser cache then reload the page.

    Cheers!
    Ismael

    #763663

    Hi there,

    I tried to use the code that Ismael provided in his first reply but the submenu is still opening by hover.
    Has anything changed that makes this code not work in the current version of enfold?

    BR, Niemitz

    #765680

    Hi Niemitz,

    It is a normal practice, that the menu opens on hover, no extra effort by the user needed to see submenu and then yet another action to close the menu.

    But if you really want to change that code still works, I checked your avia.js (here http://www.bios-tec.de) and it does not seem to have that changed. Is this the site where you’re trying to implement it or is there a different site you’re working on?

    Best regards,
    Victoria

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