之前为大家介绍了好多导航菜单,今天给大家分享一款基于jquery的侧边栏导航。这款导航侧边滑出,适合放在手机网页或webapp。一看下实现的效果图:

在线预览   源码下载

实现的代码。

html代码:

<div style="position: relative; overflow: hidden;">
<div class="top">
<img src="menu.png" height="35" class="menu_btn" align="left" />
<font style="padding-left: 10px;">Material design animation</font>
</div>
<div id="grey_back">
&nbsp;</div>
<div id="menu_smartphone" class="menu_mobile_app" align="left">
<ul style="overflow-y: auto;">
<div class="background_profil">
</div>
<div class="pics_profil">
</div>
<div class="name_profil">
www.wifeo.com<font style="font-weight: 300; color: #999999;">/code</font></div>
<li><a href="#">MENU 1</a></li>
<li><a href="#">MENU 2</a></li>
<li><a href="#">MENU 3</a></li>
<li><a href="#">MENU 4</a></li>
</ul>
</div>
<div class="card">
</div>
<div class="card">
</div>
</div>

css代码:

  #menu_smartphone
{
height: 100%;
position: absolute;
background: #ffffff;
top:;
bottom:;
left: -570px;
width: 570px;
}
#menu_smartphone ul
{
padding:;
margin:;
list-style: none;
color: #999999;
}
#menu_smartphone ul li
{
height: 70px;
padding-left: 10px;
line-height: 70px;
}
#menu_smartphone ul li:hover
{
background: #f7f7f7;
}
#menu_smartphone ul li a
{
color: #999999;
text-decoration: none;
font-family: 'Roboto';
font-weight:;
font-size: 25px;
}
.background_profil
{
background-image: url(fond.png);
height: 240px;
}
.pics_profil
{
width: 130px;
height: 130px;
border-radius: 50%;
background-size: cover;
background-image: url(welcome.png);
margin-top: -65px;
}
.name_profil
{
font-size: 37px;
font-family: 'Roboto';
font-weight:;
color: #666666;
margin-top: -50px;
margin-left: 140px;
margin-bottom: 40px;
}
.top
{
background-color: #e51c23;
height: 70px;
position: absolute;
top: 0px;
width: 100%;
line-height: 70px;
color: #ffffff;
font-size: 20px;
font-weight:;
font-family: 'Roboto';
padding-left: 10px;
text-align: left;
}
#grey_back
{
display: none;
background-color: #000000;
opacity: 0.7;
width: 100%;
height: 100%;
position: absolute;
top:;
}
.card
{
width: 90%;
height: 300px;
background-color: #ffffff;
margin: 10px;
padding: 20px;
color: #666666;
font-weight:;
font-size: 36px;
text-align: center;
font-family: 'Roboto';
box-shadow: 0 0 2px #999999;
}
.menu_btn
{
cursor: pointer;
left: 0px;
margin-top: 16px;
}

js代码:

  $(document).ready(function () {
var isMenuOpen = false; $('.menu_btn').click(function () {
if (isMenuOpen == false) {
$("#menu_smartphone").clearQueue().animate({
left: '0px'
})
$("#grey_back").fadeIn('fast');
$(this).fadeOut(200);
$(".close").fadeIn(300); isMenuOpen = true;
}
});
$('#grey_back').click(function () {
if (isMenuOpen == true) {
$("#menu_smartphone").clearQueue().animate({
left: '-570px'
})
$("#page").clearQueue().animate({
"margin-left": '0px'
})
$("#grey_back").fadeOut('fast');
$(this).fadeOut(200);
$(".menu_btn").fadeIn(300); isMenuOpen = false;
}
});
});

注:本文爱编程原创文章,转载请注明原文地址:http://www.w2bc.com/Article/9180

一款基于jquery的侧边栏导航的更多相关文章

  1. 基于jquery的侧边栏分享导航

    今天给大家分享一款基于jquery的侧边栏分享导航.这款分享钮一直固定于左侧,鼠标经过的时候凸出显示,这款分享按钮适用浏览器:IE8.360.FireFox.Chrome.Safari.Opera.傲 ...

  2. 一款基于jQuery仿淘宝红色分类导航

    今天给大家分享一款基于jQuery仿淘宝红色分类导航.这款分类导航适用浏览器:IE8.360.FireFox.Chrome.Safari.Opera.傲游.搜狗.世界之窗.效果图如下: 在线预览    ...

  3. 一款基于jquery和css3的响应式二级导航菜单

    今天给大家分享一款基于jquery和css3的响应式二级导航菜单,这款导航是传统的基于顶部,鼠标经过的时候显示二级导航,还采用了当前流行的响应式设计.效果图如下: 在线预览   源码下载 实现的代码. ...

  4. 一款基于jquery固定于顶部的导航

    今天给大家分享一款基于jquery固定于顶部的导航,这款导航当浏览器滚动条位于顶部时,导航高度较高,当浏览器滚动向下滚动时,导航高度自动减低,并位于顶部.效果图如下: 在线预览   源码下载 实现的代 ...

  5. 一款基于jquery滑动后固定于顶部的导航

    之前已为大家介绍了好多css3实现的导航菜单.今天分享一款基于jquery滑动后固定于顶部的导航.这款导航的特点是初始位于顶部下面一百个像素,当鼠标滚动时到下方,导航一直处于顶部.效果图如下: 在线预 ...

  6. 一款基于jQuery的仿百度首页滑动选项卡

    今天给大家分享一款基于jQuery的仿百度首页滑动选项卡.这款选项卡适用浏览器:IE8.360.FireFox.Chrome.Safari.Opera.傲游.搜狗.世界之窗.效果图如下: 在线预览   ...

  7. 10款基于jquery实现的超酷动画源码

    1.jQuery二级下拉菜单 下拉箭头翻转动画 之前我们分享过不少基于jQuery的二级下拉菜单,甚至是多级的下拉菜单,比如这款jQuery/CSS3飘带状多级下拉菜单就非常华丽.但今天要介绍的这款j ...

  8. 10款基于jquery的web前端特效及源码下载

    1.jQuery时间轴插件:jQuery Timelinr 这是一款可用于展示历史和计划的时间轴插件,尤其比较适合一些网站展示发展历程.大事件等场景.该插件基于jQuery,可以滑动切换.水平和垂直滚 ...

  9. 基于jQuery垂直多级导航菜单代码

    基于jQuery垂直多级导航菜单代码是一款黑色风格的jQuery竖直导航菜单特效下载.效果图如下: 在线预览   源码下载 实现的代码. html代码: <ul class="ce&q ...

随机推荐

  1. python3.x 和 python2.x关于 urllib的用法

    在python2.x版本中可以直接使用import urllib来进行操作,但是python3.x版本中使用的是import urllib.request来进行操作,下面是简单的例子: python2 ...

  2. HDUOJ---4503 湫湫系列故事——植树节

    湫湫系列故事——植树节 Time Limit: 1000/500 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others)Total ...

  3. HDUOJ--1159Common Subsequence

    Common Subsequence Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Other ...

  4. HDUOJ----(1016)Prime Ring Problem

    Prime Ring Problem Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Other ...

  5. HTML中button和input button的区别

    button和input button的区别 一句话概括主题:<button>具有<input type="button" ... >相同的作用但是在可操控 ...

  6. java多线程学习--java.util.concurrent

    CountDownLatch,api 文档:http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/CountDownLatch.h ...

  7. AME_IExpense费用报表通过AME审批简单例子(案例)

    2014-05-30 Created By BaoXinjian

  8. OGG_GoldenGate安装和环境搭建(案例)

    2014-03-02 Created By BaoXinjian

  9. UNIX域套接字编程和socketpair 函数

    一.UNIX Domain Socket IPC socket API原本是为网络通讯设计的,但后来在socket的框架上发展出一种IPC机制,就是UNIX Domain Socket.虽然网络soc ...

  10. HDU 5092 DP

    DP水题 求从上到下走完,使所取得权值最小,并输出路径,若有多个满足,则输出靠右的 #include "stdio.h" #include "string.h" ...