帝王谷资源网 Design By www.wdxyy.com
之前为大家介绍了好几款css3导航,今天为大家在介绍的是一款适合放在手机网页的导航菜单。点击列表图标以下拉式的形式显示菜单,单击关闭,动画关闭。效果相当不错。效果图如下:
源码下载
这个实例由css3和依赖于jquery插件。下面是实现代码
html代码:
复制代码代码如下:
<nav class="nav" role="navigation" style="height: 195px;">
<ul class="nav-items">
<li><a target=_blank href="http://www.w2bc.com">Home</a></li>
<li><a target=_blank href="http://www.w2bc.com">About</a></li>
<li><a target=_blank href="http://www.w2bc.com">Clients</a></li>
<li><a target=_blank href="http://www.w2bc.com">Contact Us</a></li>
</ul>
</nav>
<header style="-webkit-transform: translate3d(0px, 195px, 0px);">
<button class="menu-button-target active" data-ic-class="button-trigger">
<span class="menu-button"></span>
</button>
Example Header
</header>
<section>
<article>
</article>
<article>
</article>
<article>
</article>
<article>
</article>
<article>
</article>
</section>
css3代码:
复制代码代码如下:
*
{
box-sizing: border-box;
}
body
{
font-family: "HelveticaNeue-Light" , "Helvetica Neue Light" , "Helvetica Neue" , Helvetica, Arial, "Lucida Grande" , sans-serif;
font-weight: 300;
}
nav
{
position: fixed;
-webkit-transform: translate3d(0, 0, 0);
left: 0;
transition: all 0.4s ease;
width: 100%;
background: #34495e;
height: 0;
overflow: hidden;
transition-delay: 0.25s;
}
.active nav
{
transition-delay: 0s;
}
nav ul
{
width: 95%;
margin: 0 auto;
}
nav ul li
{
padding: 5px;
border-bottom: 1px solid white;
}
nav ul li:nth-child(1) a
{
transition-delay: 0.1s;
}
nav ul li:nth-child(2) a
{
transition-delay: 0.15s;
}
nav ul li:nth-child(3) a
{
transition-delay: 0.2s;
}
nav ul li:nth-child(4) a
{
transition-delay: 0.25s;
}
nav ul li:last-child
{
border: none;
}
nav ul li a
{
transition: all 0.2s cubic-bezier(0.455, 0.03, 0.515, 0.955);
position: relative;
display: block;
text-decoration: none;
color: white;
font-size: 18px;
padding: 10px;
-webkit-transform: translate3d(100px, 0, 0);
opacity: 0;
}
.active nav ul li a
{
-webkit-transform: translateX(0);
opacity: 1;
}
header
{
transition: all 0.4s ease;
-webkit-transform: translate3d(0, 0, 0);
left: 0;
width: 100%;
position: fixed;
background: #27ae60;
color: white;
padding: 20px;
text-align: center;
font-size: 20px;
transition-delay: 0.25s;
}
.active header
{
transition-delay: .08s;
}
section
{
background: #f5f5f5;
padding-top: 80px;
}
article
{
background: white;
height: 500px;
width: 95%;
border-radius: 3px;
margin: 0 auto 20px auto;
border: 1px solid #e4e4e4;
}
.menu-button-target
{
background: transparent;
border: none;
outline: none;
cursor: pointer;
position: absolute;
z-index: 200;
left: 10px;
height: 50px;
top: 50%;
margin-top: -23px;
webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
.menu-button-target.active .menu-button
{
transition: background .2s ease;
background-color: transparent;
}
.menu-button-target.active .menu-button:before, .menu-button-target.active .menu-button:after
{
transition: top .3s ease, -webkit-transform .3s .2s ease;
}
.menu-button-target.active .menu-button:before
{
top: 0;
-webkit-transform: rotate(45deg);
}
.menu-button-target.active .menu-button:after
{
top: 0;
-webkit-transform: rotate(-45deg);
}
.menu-button
{
position: relative;
top: 50%;
left: 0;
display: block;
width: 40px;
height: 4px;
margin-top: -2px;
background-color: white;
border-radius: 10px;
transition: background .2s .2s;
}
.menu-button:before, .menu-button:after
{
content: "";
display: block;
position: absolute;
width: 100%;
height: 100%;
left: 0;
background-color: white;
transition: top .3s .2s ease, -webkit-transform .3s ease;
border-radius: 10px;
-webkit-transform-origin: 50% 50%;
}
.menu-button:before
{
top: -10px;
-webkit-transform: rotate(0deg);
}
.menu-button:after
{
top: 10px;
-webkit-transform: rotate(0deg);
}
js代码:
复制代码代码如下:
var $menuTrigger = $('[data-ic-class="button-trigger"]'),
$menuOverlay = $('[data-ic-class="overlay"]'),
$menuItem = $('.menu-item'),
activeClass = 'active',
$nav = $('nav'),
$navULHeight = $('.nav-items').outerHeight(),
navOpen = false,
$header = $('header');
var isTouch = false;
if ($('html').hasClass('touch')) {
isTouch = true;
}
function menuFunction() {
$menuTrigger.toggleClass(activeClass);
if (!navOpen) {
$nav.height($navULHeight);
navOpen = true;
$('body').addClass('active');
$header.css('transform', 'translate3d(0, ' + $navULHeight + 'px, 0)');
} else {
$nav.height(0);
$header.css('transform', 'translate3d(0, 0, 0)');
navOpen = false;
$('body').removeClass('active');
}
}
if (isTouch) {
$menuTrigger.on('touchstart', function () {
menuFunction();
});
}
if (!isTouch) {
$menuTrigger.on('click', function () {
menuFunction();
});
}
源码下载
这个实例由css3和依赖于jquery插件。下面是实现代码
html代码:
复制代码代码如下:
<nav class="nav" role="navigation" style="height: 195px;">
<ul class="nav-items">
<li><a target=_blank href="http://www.w2bc.com">Home</a></li>
<li><a target=_blank href="http://www.w2bc.com">About</a></li>
<li><a target=_blank href="http://www.w2bc.com">Clients</a></li>
<li><a target=_blank href="http://www.w2bc.com">Contact Us</a></li>
</ul>
</nav>
<header style="-webkit-transform: translate3d(0px, 195px, 0px);">
<button class="menu-button-target active" data-ic-class="button-trigger">
<span class="menu-button"></span>
</button>
Example Header
</header>
<section>
<article>
</article>
<article>
</article>
<article>
</article>
<article>
</article>
<article>
</article>
</section>
css3代码:
复制代码代码如下:
*
{
box-sizing: border-box;
}
body
{
font-family: "HelveticaNeue-Light" , "Helvetica Neue Light" , "Helvetica Neue" , Helvetica, Arial, "Lucida Grande" , sans-serif;
font-weight: 300;
}
nav
{
position: fixed;
-webkit-transform: translate3d(0, 0, 0);
left: 0;
transition: all 0.4s ease;
width: 100%;
background: #34495e;
height: 0;
overflow: hidden;
transition-delay: 0.25s;
}
.active nav
{
transition-delay: 0s;
}
nav ul
{
width: 95%;
margin: 0 auto;
}
nav ul li
{
padding: 5px;
border-bottom: 1px solid white;
}
nav ul li:nth-child(1) a
{
transition-delay: 0.1s;
}
nav ul li:nth-child(2) a
{
transition-delay: 0.15s;
}
nav ul li:nth-child(3) a
{
transition-delay: 0.2s;
}
nav ul li:nth-child(4) a
{
transition-delay: 0.25s;
}
nav ul li:last-child
{
border: none;
}
nav ul li a
{
transition: all 0.2s cubic-bezier(0.455, 0.03, 0.515, 0.955);
position: relative;
display: block;
text-decoration: none;
color: white;
font-size: 18px;
padding: 10px;
-webkit-transform: translate3d(100px, 0, 0);
opacity: 0;
}
.active nav ul li a
{
-webkit-transform: translateX(0);
opacity: 1;
}
header
{
transition: all 0.4s ease;
-webkit-transform: translate3d(0, 0, 0);
left: 0;
width: 100%;
position: fixed;
background: #27ae60;
color: white;
padding: 20px;
text-align: center;
font-size: 20px;
transition-delay: 0.25s;
}
.active header
{
transition-delay: .08s;
}
section
{
background: #f5f5f5;
padding-top: 80px;
}
article
{
background: white;
height: 500px;
width: 95%;
border-radius: 3px;
margin: 0 auto 20px auto;
border: 1px solid #e4e4e4;
}
.menu-button-target
{
background: transparent;
border: none;
outline: none;
cursor: pointer;
position: absolute;
z-index: 200;
left: 10px;
height: 50px;
top: 50%;
margin-top: -23px;
webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
.menu-button-target.active .menu-button
{
transition: background .2s ease;
background-color: transparent;
}
.menu-button-target.active .menu-button:before, .menu-button-target.active .menu-button:after
{
transition: top .3s ease, -webkit-transform .3s .2s ease;
}
.menu-button-target.active .menu-button:before
{
top: 0;
-webkit-transform: rotate(45deg);
}
.menu-button-target.active .menu-button:after
{
top: 0;
-webkit-transform: rotate(-45deg);
}
.menu-button
{
position: relative;
top: 50%;
left: 0;
display: block;
width: 40px;
height: 4px;
margin-top: -2px;
background-color: white;
border-radius: 10px;
transition: background .2s .2s;
}
.menu-button:before, .menu-button:after
{
content: "";
display: block;
position: absolute;
width: 100%;
height: 100%;
left: 0;
background-color: white;
transition: top .3s .2s ease, -webkit-transform .3s ease;
border-radius: 10px;
-webkit-transform-origin: 50% 50%;
}
.menu-button:before
{
top: -10px;
-webkit-transform: rotate(0deg);
}
.menu-button:after
{
top: 10px;
-webkit-transform: rotate(0deg);
}
js代码:
复制代码代码如下:
var $menuTrigger = $('[data-ic-class="button-trigger"]'),
$menuOverlay = $('[data-ic-class="overlay"]'),
$menuItem = $('.menu-item'),
activeClass = 'active',
$nav = $('nav'),
$navULHeight = $('.nav-items').outerHeight(),
navOpen = false,
$header = $('header');
var isTouch = false;
if ($('html').hasClass('touch')) {
isTouch = true;
}
function menuFunction() {
$menuTrigger.toggleClass(activeClass);
if (!navOpen) {
$nav.height($navULHeight);
navOpen = true;
$('body').addClass('active');
$header.css('transform', 'translate3d(0, ' + $navULHeight + 'px, 0)');
} else {
$nav.height(0);
$header.css('transform', 'translate3d(0, 0, 0)');
navOpen = false;
$('body').removeClass('active');
}
}
if (isTouch) {
$menuTrigger.on('touchstart', function () {
menuFunction();
});
}
if (!isTouch) {
$menuTrigger.on('click', function () {
menuFunction();
});
}
标签:
折叠,导航菜单
帝王谷资源网 Design By www.wdxyy.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
帝王谷资源网 Design By www.wdxyy.com
暂无评论...
稳了!魔兽国服回归的3条重磅消息!官宣时间再确认!
昨天有一位朋友在大神群里分享,自己亚服账号被封号之后居然弹出了国服的封号信息对话框。
这里面让他访问的是一个国服的战网网址,com.cn和后面的zh都非常明白地表明这就是国服战网。
而他在复制这个网址并且进行登录之后,确实是网易的网址,也就是我们熟悉的停服之后国服发布的暴雪游戏产品运营到期开放退款的说明。这是一件比较奇怪的事情,因为以前都没有出现这样的情况,现在突然提示跳转到国服战网的网址,是不是说明了简体中文客户端已经开始进行更新了呢?
更新日志
2024年12月24日
2024年12月24日
- 小骆驼-《草原狼2(蓝光CD)》[原抓WAV+CUE]
- 群星《欢迎来到我身边 电影原声专辑》[320K/MP3][105.02MB]
- 群星《欢迎来到我身边 电影原声专辑》[FLAC/分轨][480.9MB]
- 雷婷《梦里蓝天HQⅡ》 2023头版限量编号低速原抓[WAV+CUE][463M]
- 群星《2024好听新歌42》AI调整音效【WAV分轨】
- 王思雨-《思念陪着鸿雁飞》WAV
- 王思雨《喜马拉雅HQ》头版限量编号[WAV+CUE]
- 李健《无时无刻》[WAV+CUE][590M]
- 陈奕迅《酝酿》[WAV分轨][502M]
- 卓依婷《化蝶》2CD[WAV+CUE][1.1G]
- 群星《吉他王(黑胶CD)》[WAV+CUE]
- 齐秦《穿乐(穿越)》[WAV+CUE]
- 发烧珍品《数位CD音响测试-动向效果(九)》【WAV+CUE】
- 邝美云《邝美云精装歌集》[DSF][1.6G]
- 吕方《爱一回伤一回》[WAV+CUE][454M]