js 제어 브라우저 스크롤 바 비활성화

1483 단어
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
      <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
      <title> </title>
    </head>
    <body>
      <div id="objDiv" style="width:400px;height:300px;background:red"> </div>
    <script type="text/javascript">
        var scrollFunc=function(e){
            e=e||window.event;
           if (e&&e.preventDefault){ 
                e.preventDefault();
                e.stopPropagation();
            }else{ 
             e.returnvalue=false;  
             return false;     
            }
        }
        var obj=document.getElementById("objDiv");
        if(obj.addEventListener&&!window.opera)
        obj.addEventListener('DOMMouseScroll',scrollFunc,false);
        else
        obj.onmousewheel=scrollFunc;
    </script>
    <script>
        // 500 <br> !
        for (var i=0 ;i<500;i++){
         document.write("<br>");
        }
    </script>
    </body>
    </html>

좋은 웹페이지 즐겨찾기