WordPress.org

Ready to get started?Download WordPress

Forums

DevDmBootstrap3
[resolved] how to have drop down on hover for main menu (4 posts)

  1. pipedragon72
    Member
    Posted 3 months ago #

    hi there
    can you tell me how to have the child elements appearing on hover for the main menu? at the moment they only appear on click and i need them to appear on hover.
    many thanks!

  2. DevDm
    Member
    Theme Author

    Posted 2 months ago #

    Hey Pipedragon!

    I actually wrote a bit of jQuery to handle this.

    jQuery(document).ready(function ($) {

    //only enable drop down hover when the mobile menu isn't displayed
    var $window = $(window);

    function checkWidth() {
    var windowsize = $window.width();
    if (windowsize > 767) {

    $('.dmbs-top-menu .navbar-inverse .navbar-nav li').mouseenter(function(){
    $('ul',this).stop().slideDown();
    });

    $('.dmbs-top-menu .navbar-inverse .navbar-nav li').mouseleave(function(){
    $('ul',this).stop().slideUp();
    });
    }
    }
    // Execute on load
    checkWidth();
    // Bind event listener
    $(window).resize(checkWidth);

    });

  3. pipedragon72
    Member
    Posted 2 months ago #

    perfecto! thanks so much :-)

  4. dremoo1
    Member
    Posted 1 month ago #

    Wow, awesome! I am new to wordpress & also rather unfamiliar with PHP and JQuery. could you tell me how to implement this? my site is at:

    http://www.augustamerealestate.com/home-alt/ . I am using a child theme of your theme.

Reply

You must log in to post.

About this Theme

About this Topic