我有accordion
<div class="panel-group" id="accordion">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapseOne">FAQ</a>
</h4>
</div>
<div id="collapseOne" class="panel-collapse collapse in">
<div class="panel-body">
...
</div>
</div>
</div>
我希望accordion
默认值在桌面浏览器上展开,但在移动浏览器上展开。我已尝试将<div id="collapseOne" class="panel-collapse collapse in">
更改为<div id="collapseOne" class="panel-collapse collapse var">
并在我的.css
中添加以下内容:
@media(max-width:767px) {
.collapse.var{
display:none;
}
.collapse.in.var{
display:block;
}
}
@media(min-width:768px) {
.collapse.var{
display:block;
}
.collapse.in.var{
display:none;
}
}
但桌面版本存在漏洞,即使面板消失,内容仍会显示。任何帮助将不胜感激!
答案 0 :(得分:0)
我想知道如何在不破坏所有内容的情况下使用 CSS 中的if_merge = 0
here_merge = 0
deleting = False
x = 0
while x < len(whole_st_gen):
for y in range (x+1, len(whole_st_gen)):
if whole_end_gen[x]>whole_end_gen[y]:
deleting = True
here_merge = y
else:
break
if deleting == True:
deleting = False
del whole_st_gen[x:here_merge]
del whole_end_gen[x:here_merge]
else:
x += 1
here_merge = 0
print len(whole_st_gen)
sys.exit()
类,但是 jQuery 中的请求的一个解决方案将是:
.collapse
希望这可能有所帮助。