账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    这个if...else 条件为什么不成立?又不报错!
    36
    0
    <!doctype html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport"
              content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <title>Document</title>
        <style>
            *{
                margin: 0;
                padding: 0;
            }
            header{
                width: 100%;
                position: fixed;
                top: 0;
            }
            .up{
                height: 55px;
                background-color: darkgreen;
                cursor: pointer;
    
            }
            .low{
                height: 60px;
                background-color: darkgray;
            }
            .ad{
                height: 340px;
                background-color: #3a945b;
                margin-top: 115px;
            }
            article{
                height: 1000px;
                background-color: orange;
            }
            footer
            {
                height: 320px;
                background-color: #1a1a1a;
            }
        </style>
        <script src="src/javascript/jquery-3.2.1.js"></script>
        <script>
            $(function () {
              var w = $('body').width();
              $('.up').click(function () {
                if(w>'1280px'){
                  $('.low').animate({marginTop:200})
                }else{
                  $('.low').animate({marginTop:50})
                }
              });
            });
        </script>
    </head>
    <body>
    <header>
        <section class="up"></section>
        <section class="low"></section>
    </header>
    <div class="ad"></div>
    <article></article>
    <footer></footer>
    </body>
    </html>

    if 没作用,else可以?

    0
    打赏
    收藏
    点击回答
        全部回答
    • 0
    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部