码迷,mamicode.com
首页 > 其他好文 > 详细

jq右侧划出

时间:2017-11-02 00:01:03      阅读:236      评论:0      收藏:0      [点我收藏+]

标签:display   rgb   osi   ogg   jquery   index   z-index   color   absolute   

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>右侧划出</title>
    <style>
.menu-mobile { position: fixed; right: -200px; width: 260px; height: 100%; top: 0; z-index: 10; text-align: left; }
.menu-mobile.menu-open { right: 0px; }
.menu-wrap { position: absolute; top: 0; left: 60px; background: #1a1a1a; width: 200px; height: 100%; }
.menu-close { cursor: pointer; display: block; position: absolute; font-size: 14px; color: #808080; width: 40px; height: 40px; line-height: 40px; top: 20px; right: 5px; -webkit-transition: all .1s ease-in-out; -moz-transition: all .1s ease-in-out; -ms-transition: all .1s ease-in-out; -o-transition: all .1s ease-in-out; transition: all .1s ease-in-out; }
.menu-close:hover { color: #ffffff; -webkit-transition: all .1s ease-in-out; -moz-transition: all .1s ease-in-out; -ms-transition: all .1s ease-in-out; -o-transition: all .1s ease-in-out; transition: all .1s ease-in-out; }
.body-push-toright { left: 200px; }
.body-push-toleft { left: -200px; }
.menu-mobile { -webkit-transition: all .3s ease; -moz-transition: all .3s ease; -ms-transition: all .3s ease; -o-transition: all .3s ease; transition: all .3s ease; }
#menuToggle { position: absolute; top: 20px; left: 0; z-index: 11; display: block; text-align: center; font-size: 14px; color: #ffffff; width: 40px; height: 40px; line-height: 40px; cursor: pointer; background: rgba(0, 0, 0, 0.25); -webkit-transition: all .1s ease-in-out; -moz-transition: all .1s ease-in-out; -ms-transition: all .1s ease-in-out; -o-transition: all .1s ease-in-out; transition: all .1s ease-in-out; }
#menuToggle:hover { color: #ffffff; background: rgba(0, 0, 0, 0.2); -webkit-transition: all .1s ease-in-out; -moz-transition: all .1s ease-in-out; -ms-transition: all .1s ease-in-out; -o-transition: all .1s ease-in-out; transition: all .1s ease-in-out; }
.menu-wrap ul li { list-style: none; color: #fff; }
    </style>
</head>

<body>
    <nav class="menu-mobile" id="menu-mobile">
        <div class="menu-wrap">
            <i class="menu-close">close</i>
            <ul>
                <li><span>111</span></li>
                <li><span>222</span></li>
                <li><span>333</span></li>
            </ul>
        </div>
        <div id="menuToggle"><i>22</i></div>
    </nav>

    
    <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.js"></script>
</body>
<script>
    $(#menuToggle, .menu-close).on(click, function() {
        $(#menuToggle).toggleClass(active);
        $(body).toggleClass(body-push-toleft);
        $(#menu-mobile).toggleClass(menu-open);
    });
</script>
</body>

</html>

 

jq右侧划出

标签:display   rgb   osi   ogg   jquery   index   z-index   color   absolute   

原文地址:http://www.cnblogs.com/Doduo/p/7768884.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!