简体   繁体   English

Bootstrap的导航下拉切换问题

[英]Navigation Drop-Down Toggle Issues with Bootstrap

I recently had my Wordpress site's homepage redesigned at www.seosherpas.com. 最近,我在www.seosherpas.com上重新设计了Wordpress网站的主页。

That was designed on a theme that uses Bootstrap. 这是在使用Bootstrap的主题上设计的。 It is implemented on Thesis by taking the code of the customized site, which is installed in a sub-folder, and copied and pasted into a custom page template. 它通过使用定制站点的代码在Thesis上实现,该代码安装在子文件夹中,然后复制并粘贴到定制页面模板中。

Now I'm trying to mimic the navigation menu site-wide on my customized Thesis design: www.seosherpas.com/blog/ 现在,我试图在我的自定义论文设计中模仿整个站点的导航菜单:www.seosherpas.com/blog/

I've managed to mimic the design, but cannot get the drop down menus to work. 我已经设法模仿了该设计,但是无法使用下拉菜单。 I have a feeling it's an issue with how I'm calling Bootstrap's Javascript... maybe, maybe not. 我感觉这与我如何调用Bootstrap的Javascript有关……也许,也许不是。 I really have no idea. 我真的不知道。

I have this line of code to temporarily hide the dropdown: 我有以下代码行可暂时隐藏下拉列表:

.nav-collapse .dropdown-menu {
border-bottom: 1px solid #DDDDDD;
/* Temporary Fix??? display: block; */
}

If I show 'display: block;' 如果我显示“显示:阻止;” the drop down appears but is always appearing, instead of only when hovering. 下拉菜单会出现,但始终会显示,而不是仅在悬停时显示。

Add this to your CSS: 将此添加到您的CSS:

.nav-collapse:hover .dropdown-menu {
    display: block;
}

And you'll only see the dropdown when you hover over the .nav-collapse element which is the dropdown's parent. 而且,只有将鼠标悬停在下拉菜单的父元素.nav-collapse元素上时,才会看到该下拉菜单。 Works every time, every browser. 每次浏览器均可运行。 Enjoy! 请享用!

Thesis Wordpress themes always use bootstarp on every time you use it, javascrippt enabled onto the drop down menu. 论文Wordpress主题每次使用时总是使用bootstarp,在下拉菜单中启用了javascrippt。 Check out this article for more reference. 查看本文以获得更多参考。 http://www.themesrush.com/wordpress-theme-thesis-review/ http://www.themesrush.com/wordpress-theme-thesis-review/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM