html5手机端的点击弹出侧边滑动菜单代码

时间:2024-04-04 11:05:45

效果预览:http://hovertree.com/texiao/html5/19/

本效果适用于移动设备,可以使用手机等浏览效果。

源码下载:http://hovertree.com/h/bjaf/mwvn0mxi.htm

本实例用到了toggleClass方法,请参考:http://hovertree.com/h/bjaf/attributes_toggleclass.htm

代码如下:

 <!doctype html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>jQuery弹出侧边栏滑动菜单 - 何问起</title><base target="_blank" />
<link rel="stylesheet" href="http://hovertree.com/texiao/html5/19/css/reset.css">
<link rel="stylesheet" href="http://hovertree.com/texiao/html5/19/css/style.css"> <script language="javascript" src="http://hovertree.com/ziyuan/jquery/jquery-2.2.0.min.js"></script>
<script language="javascript" src="js/main.js"></script>
<!--[if IE]>
<script src="http://hovertree.com/texiao/html5/4/html5shiv.min.js"></script>>
<![endif]-->
</head>
<body> <main>
<header class="header">
<h1>jQuery弹出侧边栏滑动菜单 <span>A Full-Screen Pushing Navigation</span></h1>
<p>A full page menu, that replaces the current content by pushing it off the screen.</p>
<p><a href="http://hovertree.com/">首页</a> <a href="http://hovertree.com/texiao/">特效</a> <a href="http://hovertree.com/h/bjaf/manpingmenu.htm">原文</a>
</p>
</header>
</main> <a href="#cd-nav" class="cd-nav-trigger">
Menu
<span class="cd-nav-icon"></span>
<svg x="0px" y="0px" width="54px" height="54px" viewBox="0 0 54 54">
<circle fill="transparent" stroke="#656e79" stroke-width="1" cx="27" cy="27" r="25" stroke-dasharray="157 157" stroke-dashoffset="157"></circle>
</svg>
</a> <div id="cd-nav" class="cd-nav">
<div class="cd-navigation-wrapper">
<div class="cd-half-block">
<h2>导航菜单</h2> <nav>
<ul class="cd-primary-nav">
<li><a href="http://hovertree.com/h/bjaf/menulayer.htm" class="selected">我的</a></li>
<li><a href="http://hovertree.com/h/bjaf/easysector.htm">内容</a></li>
<li><a href="http://hovertree.com/h/bjaf/jqguding.htm">消息</a></li>
<li><a href="http://hovertree.com/h/bjaf/csshouse.htm">模板</a></li>
<li><a href="http://hovertree.com/hvtart/bjae/ipblia78.htm">设置</a></li>
<li><a href="http://hovertree.com/h/bjaf/tcpip_addressing.htm">关于</a></li>
</ul>
</nav>
</div> <div class="cd-half-block">
<address>
<ul class="cd-contact-info">
<li><a href="mailto:hovertree@hovertree.com">hovertree@hovertree.com</a></li>
<li>021-00000000</li>
<li>
<span>何问起</span>
<span>hovertree.com</span>
<span>keleyi菜单</span>
</li>
</ul>
</address>
</div>
</div>
</div>
</body>
</html>

更多特效:http://www.cnblogs.com/roucheng/p/texiao.html