Javascript 使用setTimeout或动画css3时,如何使用Phonegap和fixed div?

Javascript 使用setTimeout或动画css3时,如何使用Phonegap和fixed div?,javascript,android,jquery,css,cordova,Javascript,Android,Jquery,Css,Cordova,当我将fixed div放在顶部并使用SetTimeout或css3的动画时,div会改变他的位置 滚动时,div改变位置并向下或向上移动取决于滚动方向 <html> <head> <script> cargart(); function cargart(){ setTimeout("cargart()",1000); document.getElementById("tmap").innerHTML= new Date(); } &

当我将fixed div放在顶部并使用SetTimeout或css3的动画时,div会改变他的位置

滚动时,div改变位置并向下或向上移动取决于滚动方向

 <html>
<head>
<script>
    cargart();
function cargart(){
    setTimeout("cargart()",1000);
    document.getElementById("tmap").innerHTML= new Date();
}
</script>
<style>
    #menuindex2{
        position:fixed;
        background-color: #111111;
        width:100%;
        height:52px;
    }
    #tmap{
        position:absolute;
        margin-top:55px;

    }

</style>
</head>


<body >
<div id="menuindex2">
    div fixed
</div>

<div id="tmap">

</div>

</body>
</html>

卡加特();
函数cargart(){
setTimeout(“cargart()”,1000);
document.getElementById(“tmap”).innerHTML=新日期();
}
#菜单索引2{
位置:固定;
背景色:#111111;
宽度:100%;
高度:52px;
}
#tmap{
位置:绝对位置;
边缘顶部:55px;
}
分区固定

对于android,在主文件中,将窗口类型设置为“软输入\调整\调整大小”

这将使webview在显示键盘时调整大小,并且标题仍固定在屏幕顶部。在config.xml设置中也可以对ios执行同样的操作

@Override
public void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState); 
    super.loadUrl(Config.getStartUrl(), 1000*60*60*24*7);
    //getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
    getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
}