1 html
2 js
3 图示:
点击(此处)折叠或打开
- <div class="user">
- <div class="dropdown">
- <a class="dropdown-toggle" data-toggle="dropdown" style="cursor: pointer;">
-
- {% if login_user_pic is not None %}
- <img src="{{static_url("upload/img/" + login_user_pic)}}" class="img-circle" style="width: 45px;height: 45px;margin-top: -8px;">
- {% else %}
- <img src="{{static_url("img/user.jpg")}}" class="img-circle" style="width: 45px;height: 45px;margin-top: -8px;">
- {% end %}
- <b class="caret" style="margin-top: -9px;"></b>
- </a>
- <ul class="dropdown-menu">
- <li >
- <a href="/users/{{login_user_id}}"><span class="glyphicon glyphicon-user" style="height: 30px;"> 我的主页</span></a>
- </li>
- <li >
- <a href="/setting/basic"><span class="glyphicon glyphicon-wrench" style="height: 30px;"> 设置</span></a>
- </li>
- <li>
- <a href=""><span class="glyphicon glyphicon-phone" style="height: 30px;"> 联系我们</span></a>
- </li>
- <li>
- <a href="/logout"><span class="glyphicon glyphicon-off" style="height: 30px;"> 退出 {{login_user}}</span></a>
- </li>
- </ul>
- </div>
- </div>
点击(此处)折叠或打开
- //鼠标滑过导航栏下拉菜单展开
- var timer;
- $(".user").mouseover(function(){
- clearTimeout(timer);
- $(".dropdown-menu").show();
- });
- $(".user").mouseout(function(){
- timer = setTimeout(function(){
- $(".dropdown-menu").hide();
- },100);
- });
- $(".dropdown-menu").mouseover(function(){
- clearTimeout(timer);
- $(".dropdown-menu").show();
- });
- $(".dropdown-menu").mouseout(function(){
- $(".dropdown-menu").hide();
- });
![](http://img.blog.itpub.net/blog/attachment/201708/7/27181165_15020857050g8g.png?x-oss-process=style/bb)
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/27181165/viewspace-2143186/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/27181165/viewspace-2143186/