除了bootstrap之外,如何向上自定义下拉列表

时间:2017-05-26 10:18:22

标签: javascript jquery html css

我创建了一个下拉菜单,但我想让这个下拉菜单在动画视图中向上滑动。任何人都可以帮助我吗?

$('.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>

1 个答案:

答案 0 :(得分:0)

尝试使用此更新,

使用此CSS如下

.need_help_dropdown {
   padding:0; 
   display:none; 
   background:#ccc;
   position:absolute;
   bottom:0;
 }