无法阻止黑莓屏幕垂直滚动手机屏幕

时间:2013-04-18 12:46:48

标签: css cordova jquery-mobile

enter image description here

您好, 我使用jquery mobile为Blackberry开发了一个使用phonegap的屏幕。但是当我将它部署到设备时,屏幕会垂直滚动,如下图所示。我尝试了与Android设备phonegap项目相同的html,css,js组合,它根本不滚动。它似乎只在黑莓中垂直滚动。有没有办法在phonegap项目中禁用blackberry中的垂直滚动条?但是,水平滚动已成功禁用。

对此有任何帮助,我们非常感谢。我正在使用Dreamweaver来设计ui和js。并使用命令行(终端)构建和部署到黑莓设备。

我的代码如下所示:

    <!DOCTYPE html> 
    <html>
    <head>
    <meta charset="UTF-8">
    <meta name="viewport" id="viewport" content="width=device-width, height=device-       height,initial-scale=1.0, maximum-scale=1.0,user-scalable=no;"/>
    <title>jQuery Mobile Web App</title>

    <link href="jquery-mobile/jquery.mobile-1.0.min.css" rel="stylesheet" type="text/css"/>
    <script src="jquery-mobile/jquery-1.6.4.min.js" type="text/javascript"></script>
    <script src="jquery-mobile/jquery.mobile-1.0.min.js" type="text/javascript"></script>
    <link rel="stylesheet" type="text/css" href="css/style.css"/>
    <script type="application/javascript" src="js/application.js">
    </script>
    <style type="text/css">
    #page{
    overflow: hidden;
    }
    </style>
    <script type="application/javascript">  
$(document).ready(function(e) {
    var width = $(window).width(),
        height = $(window).height() - $("#header").height(),
        row = height / 2,
        iconTopSpace = (Number(row) - 50) / 2;          
        $("div ul li a").attr("style", "height:"+row+"px");
        $(".ui-btn-inner").attr("style","margin-top:"+iconTopSpace+"px");
});
    </script>

    </head> 
    <body> 

    <div data-role="page" id="page">

<div data-role="header" id="header">
    <h1>Our Workplace</h1>
</div>



    <!-- Do this for the blackberry with a higher screen width -->

    <div data-role="navbar">
<ul>
    <li><a href="Ourworkplace.html" data-transition="slide"  data-iconpos="bottom" data-icon="our-workplace">Our Workplace</a></li>
    <li><a href="b.html" data-transition="slide" data-iconpos="bottom" data-icon="find-your-way" onClick="test()">Find your way</a></li>
    <li><a href="b.html" data-transition="slide" data-iconpos="bottom" data-icon="technology">Technology</a></li>
</ul>
     </div>
     <div data-role="navbar">
 <ul>
 <li><a href="a.html" data-transition="slide" data-iconpos="bottom" data-icon="have-an-idea">Have an Idea</a></li>
    <li><a href="b.html" data-transition="slide" data-iconpos="bottom" data-icon="useful-links">Useful links</a></li>
    <li><a href="b.html" data-transition="slide" data-iconpos="bottom" data-icon="help-desk">Help desk</a></li>
</ul>
    </div>


    </div>


    </body>
    </html>

1 个答案:

答案 0 :(得分:1)

将以下内容添加到视口内容:target-densitydpi = device-dpi