1

我有网页,当我在文本字段屏幕中输入任何数据时,我有输入字段.

这是我的代码

      <!DOCTYPE HTML>
      <html lang = "en">
      <head>
      <title>formDemo.html</title>
      <meta charset = "UTF-8" />
      <script>
      function test(){

      alert("Working");
      window.scrollTo(0,600);

       }
      </script>
      </head>
      <body>
     <h1>Form Demo</h1>
     <form>
      <label for="name">Text Input:</label>
      <input type="text"  onKeyPress="test()" name="name" id="name" value="" style="margin:400px 0 0 0;" />
      </form>
      </body>
      </html>
4

1 回答 1

2

禁用滚动:

<script type="text/javascript">
 $(document).ready(function() { 
   document.ontouchmove = function(e){
     e.preventDefault();
   }
 });
</script>
于 2013-06-19T09:05:11.017 回答