<分区>
标签 javascript jquery html css
<分区>
我创建了一个下拉菜单,但我希望此下拉菜单在动画 View 中向上滑动。谁能帮帮我?
$('.need-help').click(function() {
$('.need_help_dropdown').slideToggle();
});
.need-help {
background:url(../images/need-help.png) no-repeat; color:#000; width:100px;
text-align:center;
text-transform:uppercase;
padding-top: 10px;
padding-bottom: 4px;
float:right;
margin-top:190px;
}
.need-help i {
font-size:20px;
}
.need_help_dropdown {
padding:0;
display:none;
background:#ccc;
}
.need_help_dropdown li {
display:block;
background:#eb3b2a;
border-bottom:1px solid #fff;
}
.need_help_dropdown li a {
color:#fff;
text-decoration:none;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="need-help">
<i class="fa fa-question-circle"></i>
<br/>
Need help
<ul class="need_help_dropdown">
<li><a href="#">FAQ</a></li>
<li><a href="#">Bug or Feedback</a></li>
<li><a href="#">Close</a></li>
</ul>
</div>
最佳答案
试试这个更新,
按如下所示使用此 CSS
.need_help_dropdown {
padding:0;
display:none;
background:#ccc;
position:absolute;
bottom:0;
}
关于javascript - 除了 bootstrap 之外,如何向上自定义下拉菜单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44199068/