全屏隐藏菜单特效

<!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>全屏隐藏菜单特效</title>

    <style type="text/css">
    * { margin: 0px; padding: 0px; }
    body {
        background: #383c55;
        width: 100%;
        height: 100%;
    }
    #view-code{
      color:#4183d7;
      font-size:13px;
      text-transform:uppercase;
      font-weight:700;
      text-decoration:none;
      position:absolute;top:640px; left:50%;margin-left:-35px;
    }
    div.screen{
        width:320px;
        height:560px;
        overflow:hidden;
        position:absolute;
        top:250px;
        left:50%;
        margin-left:-160px;
        background:#31558a;
    }

    .list{margin-top:36px; text-align:left;}
    .item{
        height:115px;
        margin-top:30px 0;
        padding-left:115px;
        clear:both;
    }
    .item .img, .item span{background:#214273; border-radius:3px;}
    .item .img{float:left; width:71px; height:71px; margin-left:-93px;}
    .item span{height:11px; width:180px; margin-bottom:19px; float:left;}
    .item span:nth-of-type(3){width:75px; margin-botom:0;}

    div.burger {
        height: 30px;
        width: 40px;
        position: absolute;
        top: 11px;
        left: 21px;
        cursor: pointer;
    }
        div.x,
        div.y,
        div.z {
            position: absolute; margin: auto;
            top: 0px; bottom: 0px;
            background: #fff;
            border-radius:2px;
            -webkit-transition: all 200ms ease-out;
               -moz-transition: all 200ms ease-out;
                -ms-transition: all 200ms ease-out;
                 -o-transition: all 200ms ease-out;
                    transition: all 200ms ease-out;
        }
        div.x, div.y, div.z { height: 3px; width: 26px; }
        div.y{top: 18px;}
        div.z{top: 37px;}
        div.collapse{
            top: 20px;
            background:#4a89dc;
            -webkit-transition: all 70ms ease-out;
               -moz-transition: all 70ms ease-out;
                -ms-transition: all 70ms ease-out;
                 -o-transition: all 70ms ease-out;
                    transition: all 70ms ease-out;
        }

        div.rotate30{
            -ms-transform: rotate(30deg);
            -webkit-transform: rotate(30deg);
            transform: rotate(30deg);
            -webkit-transition: all 50ms ease-out;
               -moz-transition: all 50ms ease-out;
                -ms-transition: all 50ms ease-out;
                 -o-transition: all 50ms ease-out;
                    transition: all 50ms ease-out;
        }
        div.rotate150{
            -ms-transform: rotate(150deg);
            -webkit-transform: rotate(150deg);
            transform: rotate(150deg);
            -webkit-transition: all 50ms ease-out;
               -moz-transition: all 50ms ease-out;
                -ms-transition: all 50ms ease-out;
                 -o-transition: all 50ms ease-out;
                    transition: all 50ms ease-out;
        }

        div.rotate45{
            -ms-transform: rotate(45deg);
            -webkit-transform: rotate(45deg);
            transform: rotate(45deg);
            -webkit-transition: all 100ms ease-out;
               -moz-transition: all 100ms ease-out;
                -ms-transition: all 100ms ease-out;
                 -o-transition: all 100ms ease-out;
                    transition: all 100ms ease-out;
        }
        div.rotate135{
            -ms-transform: rotate(135deg);
            -webkit-transform: rotate(135deg);
            transform: rotate(135deg);
            -webkit-transition: all 100ms ease-out;
               -moz-transition: all 100ms ease-out;
                -ms-transition: all 100ms ease-out;
                 -o-transition: all 100ms ease-out;
                    transition: all 100ms ease-out;
        }

    div.navbar{height:73px;background:#385e97;}

    div.circle{
        border-radius: 50%;
        width: 0px;
        height: 0px;
        position:absolute;
        top: 35px;
        left: 36px;
        background:#fff;
        opacity:1;
        -webkit-transition: all 300ms cubic-bezier(0.000, 0.995, 0.990, 1.000);
           -moz-transition: all 300ms cubic-bezier(0.000, 0.995, 0.990, 1.000);
            -ms-transition: all 300ms cubic-bezier(0.000, 0.995, 0.990, 1.000);
             -o-transition: all 300ms cubic-bezier(0.000, 0.995, 0.990, 1.000);
                transition: all 300ms cubic-bezier(0.000, 0.995, 0.990, 1.000);
    }
    div.circle.expand{
        width:1200px;
        height:1200px;
        top: -560px;
        left: -565px;
        -webkit-transition: all 400ms cubic-bezier(0.000, 0.995, 0.990, 1.000);
           -moz-transition: all 400ms cubic-bezier(0.000, 0.995, 0.990, 1.000);
            -ms-transition: all 400ms cubic-bezier(0.000, 0.995, 0.990, 1.000);
             -o-transition: all 400ms cubic-bezier(0.000, 0.995, 0.990, 1.000);
                transition: all 400ms cubic-bezier(0.000, 0.995, 0.990, 1.000);                    

    }
    div.menu {
        height: 568px;
        width: 320px;
        position: absolute;
        top: 0px; left: 0px;
    }
    div.menu ul li {
        list-style: none;
        position:absolute;
        top:50px;;
        left:0;
        opacity:0;
        width:320px;
        text-align:center;
        font-size:0px;
        -webkit-transition: all 70ms cubic-bezier(0.000, 0.995, 0.990, 1.000);
           -moz-transition: all 70ms cubic-bezier(0.000, 0.995, 0.990, 1.000);
            -ms-transition: all 70ms cubic-bezier(0.000, 0.995, 0.990, 1.000);
             -o-transition: all 70ms cubic-bezier(0.000, 0.995, 0.990, 1.000);
                transition: all 70ms cubic-bezier(0.000, 0.995, 0.990, 1.000);
    }
    div.menu ul li a {
        color:#4a89dc;
        text-transform:uppercase;
        text-decoration:none;
        letter-spacing:3px;
    }

    div.menu li.animate{
        font-size:21px;
        opacity:1;
        -webkit-transition: all 150ms cubic-bezier(0.000, 0.995, 0.990, 1.000);
           -moz-transition: all 150ms cubic-bezier(0.000, 0.995, 0.990, 1.000);
            -ms-transition: all 150ms cubic-bezier(0.000, 0.995, 0.990, 1.000);
             -o-transition: all 150ms cubic-bezier(0.000, 0.995, 0.990, 1.000);
                transition: all 150ms cubic-bezier(0.000, 0.995, 0.990, 1.000);
    }
    div.menu li.animate:nth-of-type(1){
        top:120px;
        transition-delay: 0.0s;
    }
    div.menu li.animate:nth-of-type(2){
        top:190px;
        transition-delay: 0.03s;    

    }
    div.menu li.animate:nth-of-type(3){
        top:260px;
        transition-delay: 0.06s;        

    }
    div.menu li.animate:nth-of-type(4){
        top:330px;
        transition-delay: 0.09s;        

    }
    div.menu li.animate:nth-of-type(5){
        top:400px;
        transition-delay: 0.12s;        

    }
    div.menu li.animate:nth-of-type(6){
        top:470px;
        transition-delay: 0.15s;    

    }
    </style>

    <!--[if IE]>
        <script src="http://libs.useso.com/js/html5shiv/3.7/html5shiv.min.js"></script>
    <![endif]-->
</head>
<body>
    <div class="htmleaf-container">
        <div class="htmleaf-content">
            <div class="screen">
                <div class="navbar"></div>
                <div class="circle"></div>
                <div class="menu">
                    <ul>
                        <li><a href="">About</a></li>
                        <li><a href="">Share</a></li>
                        <li><a href="">Activity</a></li>
                        <li><a href="">Settings</a></li>
                        <li><a href="">Contact</a></li>
                    </ul>
                </div>
                <div class="burger">
                    <div class="x"></div>
                    <div class="y"></div>
                    <div class="z"></div>
                </div>
            </div>
        </div>
    </div>

    <script src="http://libs.useso.com/js/jquery/1.11.0/jquery.min.js"></script>
    <script>
    if (‘ontouchstart‘ in window) {
        var click = ‘touchstart‘;
    } else {
        var click = ‘click‘;
    }
    $(‘div.burger‘).on(click, function () {
        if (!$(this).hasClass(‘open‘)) {
            openMenu();
        } else {
            closeMenu();
        }
    });
    $(‘div.menu ul li a‘).on(click, function (e) {
        e.preventDefault();
        closeMenu();
    });
    function openMenu() {
        $(‘div.circle‘).addClass(‘expand‘);
        $(‘div.burger‘).addClass(‘open‘);
        $(‘div.x, div.y, div.z‘).addClass(‘collapse‘);
        $(‘.menu li‘).addClass(‘animate‘);
        setTimeout(function () {
            $(‘div.y‘).hide();
            $(‘div.x‘).addClass(‘rotate30‘);
            $(‘div.z‘).addClass(‘rotate150‘);
        }, 70);
        setTimeout(function () {
            $(‘div.x‘).addClass(‘rotate45‘);
            $(‘div.z‘).addClass(‘rotate135‘);
        }, 120);
    }
    function closeMenu() {
        $(‘div.burger‘).removeClass(‘open‘);
        $(‘div.x‘).removeClass(‘rotate45‘).addClass(‘rotate30‘);
        $(‘div.z‘).removeClass(‘rotate135‘).addClass(‘rotate150‘);
        $(‘div.circle‘).removeClass(‘expand‘);
        $(‘.menu li‘).removeClass(‘animate‘);
        setTimeout(function () {
            $(‘div.x‘).removeClass(‘rotate30‘);
            $(‘div.z‘).removeClass(‘rotate150‘);
        }, 50);
        setTimeout(function () {
            $(‘div.y‘).show();
            $(‘div.x, div.y, div.z‘).removeClass(‘collapse‘);
        }, 70);
    }
    </script>
</body>
</html>

时间: 2024-10-07 03:18:43

全屏隐藏菜单特效的相关文章

jQuery和CSS3炫酷全屏滑动菜单特效

这是一款效果非常炫酷的jQuery和CSS3全屏推拉式滑动菜单特效插件.这个插件的效果是当点击了主菜单按钮时,全屏菜单从屏幕左侧滑出,主菜单按钮动态旋转更换图标. 下图演示了这个效果的过程: 在线演示:http://www.htmleaf.com/Demo/201502131375.html 下载地址:http://www.htmleaf.com/jQuery/Menu-Navigation/201502131374.html

基于HTML5 SVG全屏滑块切换特效

基于HTML5 SVG全屏滑块切换特效是一款基于jQuery+HTML5实现的全屏动画切换特效代码.效果图如下: 在线预览   源码下载 实现的代码. html代码: <section class="cd-slider-wrapper"> <ul class="cd-slider"> <li class="visible"> <div style=" position:fixed; z-inde

模态推出 全屏 隐藏tabbar

SearchVC * vc = [[SearchVC alloc] init]; /* 底部向上  UIModalTransitionStyleCoverVertical // 淡入     UIModalTransitionStyleCrossDissolve // 翻转     UIModalTransitionStyleFlipHorizontal // 翻半页   UIModalTransitionStylePartialCurl */ vc.modalTransitionStyle =

全屏弹出特效

<!DOCTYPE html> <html lang="zh-cn"> <head> <meta charset="utf-8"> <link rel="shortcut icon" href="http://www.suning.com/favicon.ico" type="image/x-icon"> <meta http-equiv=&

一个酷炫的,基于HTML5,Jquery和Css的全屏焦点图特效,兼容各种浏览器

基于HTML5和CSS的焦点图特效,梅花图案的背景很有中国特色,而且还会动哦,效果超炫,推荐下载! 演示图 html代码 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 <html xmlns="http://www.w3.org/199

点击按钮全屏,按esc退出全屏

需求:点击按钮让页面全屏,并且菜单导航栏隐藏,content宽度100%:按esc键退出全屏,菜单导航栏显示: 问题:按esc退出全屏无法监听到键盘按下事件,(兼容性问题,监听是否全屏状态,火狐监听不起作用): 解决思路:监听页面浏览器大小,判断页面的实际高度是否等于浏览器的分辨率的高度: 注意事项:必须要把body的高度设置为100%:margin为0:padding为0:否则页面的实际高度不等于浏览器的分辨率的高度: *************************************

17种常用的jQuery全屏焦点图代码

jQuery全屏焦点图特效制作带标题的焦点图切换代码 jQuery背景和banner图片一起切换全屏焦点图切换代码 jQuery仿音悦台网站全屏带标题的焦点图轮播代码 jQuery响应式焦点图插件制作响应式全屏焦点图切换代码 jquery html5响应式幻灯片插件网站响应式全屏幻灯片轮播代码 jquery html5步步高vivo官网全屏焦点图片动画效果代码 jquery带左右按钮的全屏焦点图片切换代码 jQuery.skipper全屏响应式图片幻灯片轮播切换代码 modernizr html

腾讯X5内核使用详解(X5内核播放器使用如何去除控制栏全屏播放)以及一些注意事项

例子下载地址 https://www.lanzous.com/i2zsv5g      GIT就不用了麻烦的不行 本人安卓刚学 就上X5内核弄了老长时间由于对maven 和idea不熟悉刚开始导包都是问题(就业人员勿参考,因为此文没有水平) 先上图 解决了侧边填充不满问题(明白什么意思把?播放器侧边和安卓侧边有距离贼难看) 参考了http://www.cocoachina.com/cms/wap.php?action=article&id=25099 这个腾讯的相当于其他开源的播放器或者说浏览器

jQuery高性能跨浏览器全屏幻灯片特效插件

Nex是一款效果炫酷的.高性能的跨浏览器全屏幻灯片特效jQuery插件.该幻灯片插件允许你嵌入图片.视频,甚至是谷歌地图.该幻灯片提供了7组共34种不同的效果,可以使你适用于任何场景下使用. 它的特点有: 幻灯片外观可以自定义 优化速度 支持移动触摸设备 支持键盘导航 支持选择各种Pattern 对SEO优化十分友好 10种类型效果:Fade, Slide [left,right,top,bottom], Zoom, Skew, Rotate, Random, None 5种颜色主题:ameth