Allow click on twitter bootstrap dropdown toggle link?

后端 未结 8 1382
眼角桃花
眼角桃花 2020-11-28 04:27

We have setup the twitter bootstrap dropdown to work on hover (as opposed to click [yes we are aware of the no hover on touch devices]). But we want to be able to have the m

8条回答
  •  死守一世寂寞
    2020-11-28 04:37

    I'm not sure about the issue for making the top level anchor element a clickable anchor but here's the simplest solution for making desktop views have the hover effect, and mobile views maintaining their click-ability.

    // Medium screens and up only
    @media only screen and (min-width: $screen-md-min) {
        // Enable menu hover for bootstrap
        // dropdown menus
        .dropdown:hover .dropdown-menu {
            display: block;
        }
    }
    

    This way the mobile menu still behaves as it should, while the desktop menu will expand on hover instead of on a click.

提交回复
热议问题