如何阻止在HTML5网页中滚动?

时间:2012-04-25 09:25:08

标签: javascript ios html5

如何停止在HTML5网页中滑动和滚动?我没有使用任何脚本,但仍然滚动工作。如果重要的话,我正在使用jQuery。这是我正在使用的HTML代码:

<!DOCTYPE HTML>  
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>BRD</title>
        <link rel="shortcut icon" type="image/ico" href="images/favicon.gif" /> 
        <link rel="apple-touch-icon" href="icon.png"/>
        <link type="text/css" href="newstyle.css" rel="stylesheet" />
        <script src="js/jquery-1.7.2.min.js"></script>
        <script src="js/jquery-ui-1.8.18.custom.min.js"></script>

        <script language="javascript" type="text/javascript">  
            function showHideDiv() { 
                document.getElementById("one").style.visibility = "visible"; 
                document.getElementById("two").style.visibility = "visible"; 

                document.getElementById("three").style.visibility = "hidden"; 
                document.getElementById("four").style.visibility = "hidden"; 

                document.getElementById("radioone").style.visibility = "visible";
                document.getElementById("radiotwo").style.visibility = "hidden";
            } 
        </script>    

        <script language"javascript" type="text/javascript">
            $(document).ready(function(){
                $(".text_paragraph").fadeIn();
            });
        </script>

1 个答案:

答案 0 :(得分:0)

你的意思是翻页吗?以下JavaScript应该这样做:

document.ontouchmove = function(event){
             event.preventDefault();
}