无法使用 iPhone 间隙中的 jQuery 将 HTML 页面的高度设置为屏幕大小



确切的问题是页面超出了屏幕的高度我想禁用页面中的滚动,并希望将页面的高度设置为等于屏幕的高度 我的代码是

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width, height=device-height,  initial-scale=1, maximum-scale=1" />
        <title>
        </title>
        <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.css" />
        <style>
            /* App custom styles */
            .ui-page { background:#E3D5D4;}
            margin-bottom:40px;
        </style>
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js">
        </script>
        <script src="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.js">
        </script>
            <script type="text/javascript">
            $( function() {
                $('#submit').click(function() {
                    window.location.href = "home.html"
                });
            });

         </script>
    </head>
    <body style="margin: 0px; height:50%;width:100%;padding:0px;" scroll="no" onload='sizeContent()'>
        <div  data-role="page" id="page1" style="width:90%;
-webkit-border-radius: 5px 5px 5px 5px;-moz-border-radius: 5px 5px 5px 5px;border-radius: 5px 5px 5px 5px;
        background-color:#E3D9D9;border:20px solid #E71C15;   position: absolute; ">
            <div data-role="content" id="content">
                <div style="width:250px; height:100px; position: relative;  border: 1px solid #b8b8b8;">
                    <img src="images/new_logo.png" alt="image" style="position: absolute;" />
                </div>
                 <br />
                    <div>
                    <font color="#C32E29">
                        <b>
                          <FONT SIZE="4"> Welcome to Tune Talk</FONT>
                            <br />
                            Mobile Self Care
                        </b>
                    </div>
                    <br />
                    <div>
                            <label for="textinput1">
                                User Name/NRIC
                            </label>
                            <input id="textinput1" placeholder="" value="" type="text" />
                   </div>
                <br />
                <div>
                        <label for="textinput2">
                            Password
                        </label>
                        <input id="textinput2" placeholder="" value="" type="password" />
                </div>
                <br />
                <br />
                <div class="ui-grid-a">
                    <div class="ui-block-a">
                       <Input type="image" id="registerbtn" src="images/registerbtn.png" 
                        style="width:97px; padding:5px;  border:1px solid #E3D5D4;" 
                         value="Input type=image" data-role="none"/>
                       <br />
                       <br />
                    </div>
                    <div class="ui-block-b">
                       <Input type="image" id="loginbtn" src="images/loginbtn.png" 
                    style="width:97px; padding:5px;  border:1px solid #E3D5D4;" 
                         value="Input type=image" data-role="none"/>
                    </div>
                </div>

            </div>
        </div>
        <script>
            //App custom javascript
        </script>
    </body>
</html>

任何人都可以帮助我吗

添加此元标记。 应该适合你

 <meta name="viewport" content="width=device-width; initial-scale=1; user-scalable=no;">

最新更新