横竖屏温馨提示

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>test</title>
    <meta name="keywords" content=""/>
    <script>
        !function(){function a(){document.documentElement.style.fontSize=document.documentElement.clientWidth/640*10/16*1000+"%"}var b=null;window.addEventListener("resize",function(){clearTimeout(b);b=setTimeout(a,300)},!1);a()}(window);
    </script>
    <style>
        /*重置样式*/
        body,dl,dd,ul,ol,h1,h2,h3,h4,h5,h6,p,form{margin:0;}
        body,button,input,select,textarea{font:12px/1.5 tahoma,'\5FAE\8F6F\96C5\9ED1',sans-serif;}
        h1,h2,h3,h4,h5,h6{font-size:100%;}
        em,b,i{font-style:normal;}
        a{text-decoration:none;outline:none;}
        img{border:0;}
        ul{list-style:none;}
        button,input,select,textarea{font-size:100%;outline:none;}
        table{border-collapse:collapse;border-spacing:0;}
        td,th,ul,ol{padding:0;}

        /* 横屏提示 */
        @keyframes Shine_landscapeAni { 0% { transform: rotate(-90deg); } 30% { transform: rotate(-90deg); } 70% { transform: rotate(0deg); } 100% { transform: rotate(0deg); } }
        @-webkit-keyframes Shine_landscapeAni { 0% { transform: rotate(-90deg); } 30% { transform: rotate(-90deg); } 70% { transform: rotate(0deg); } 100% { transform: rotate(0deg); } }
        .shine_landscape { width: 100%; height: 100%; background: #32373b; position: fixed; left: 0; top: 0; z-index: 99999; display: none; text-align: center; }
        .shine_landscape_box { position: relative; margin-left: auto; margin-right: auto; top: 50%; transform: translateY(-50%); -webkit-transform: translateY(-50%); }
        .shine_landscape img { -webkit-animation: Shine_landscapeAni 1.5s ease infinite alternate; width: auto !important; animation: Shine_landscapeAni 1.5s ease infinite alternate; }
        .shine_landscape span { font-size: 0.42rem; display: block; color: #ffd40a; text-align: center; width: 100%; padding-top: 0.1rem; line-height: 2; }
    </style>
</head>

<body>



<!--横屏提示-->
<div class="shine_landscape" id="Shine_landscape">
    <div class="shine_landscape_box">
        <img src="//ossweb-img.qq.com/images/chanpin/tgclub/public/a20160321hyrzinside/mobile-phone.png">
        <span>为了更好的体验,请将手机/平板横过来</span>
    </div>
</div>

<script type="text/javascript" src="//ossweb-img.qq.com/images/js/zepto/zepto.min.js"></script>

<script>
    var cimi= {
        init: function () {
            //横竖屏提示
            cimi.orientationFun('.shine_landscape');
            window.addEventListener("onorientationchange" in window ? "orientationchange" : "resize", function () {
                cimi.orientationFun('.shine_landscape');
            }, false);
        },
        //横屏提示
        orientationFun:function (popobj){
            if (window.orientation === 180 || window.orientation === 0) {
                //竖屏
                $(popobj).show();
            }else if (window.orientation === 90 || window.orientation === -90 ){
                //横屏
                $(popobj).hide();
            }
        }
    };
    cimi.init();
</script>
</body>
</html>
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值