我有一个使用bootstrap3实现的下拉菜单,我想在下载时只显示下拉菜单而不是悬停。我的代码目前:
// I want to merge this
var data = [{
name: "id[]",
value: "1"
}, {
name: "id[]",
value: "3"
}, {
name: "task",
value: "restoreRecord"
}];
// with this
var types = ['type1', 'type2'];
for(var i = 0; i < types.length; i++){
data.push({
name: 'types[]',
value: types[i]
});
}
console.log(data);
我找到了一些答案,据说如果我在title = "Accueil"
url = "/"
layout = "default"
is_hidden = 0
[blogPosts]
pageNumber = "{{ :page }}"
postsPerPage = 4
noPostsMessage = "No posts found"
sortOrder = "published_at desc"
categoryPage = "actualite"
postPage = "blog-detail"
==
{% set posts = blogPosts.posts %}
{% for post in posts %}
<div class="col-sm-3 col-xs-6">
<figure>
<a href="{{ post.url }}"><img
data-src="{{ first.filename }}"
src="{{ post.featured_images[0].thumb(250, 166) }}"
alt="{{ first.description }}"
/></a>
<figcaption class="bordered no-top-border">
<div class="info">
<h5><a href="{{ post.url }}">{{ post.title }}</a></h5>
<p class="info">
{{ post.published_at|date('d.m.Y') }}
</p>
</div><!-- /.info -->
</figcaption>
</figure>
</div><!-- /.col -->
{% endfor %}
<a href="{{ 'blog'|page }}">All blog posts</a>
上使用<li class="dropdown">
<a href="#" class="dropdown-toggle disabled" id="without-avatar" data-toggle="dropdown" type="button" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-lg fa-bars"></i>
</a>
<ul class = "dropdown-menu">
<li>......</li>
......
</ul>
</li>
,那么下拉菜单只有在点击时才可用,而不是悬停。不幸的是,代码无效。我猜答案已经过时了。
截至2016年,解决此问题的首选方法是什么?
答案 0 :(得分:2)
悬停时,Bootstrap下拉列表不会下拉。请检查封闭元素上的代码,以找到定义有问题的悬停事件的位置。