我需要在加载web applcation时隐藏ipod touch中的URL栏,我尝试了在线找到的所有可能的解决方案,包括在这里找到的解决方案:http: //www.iphonemicrosites.com/tutorials/how-to-hide-the-地址栏合mobilesafari /
并在CSS中设置min-height,但它仅适用于横向,在配置文件模式下,它只隐藏部分URL栏而不是整个栏.有谁有任何想法?谢谢.
下面是我的代码:
<meta name="app-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="apple-touch-fullscreen" content="YES" />
<meta name="viewport" content="width=320;initial-scale=0.6666;;minimum-scale=0.6666; maximun-scale=1.0;"/>
<title>Test</title>
<script type="application/x-javascript">
addEventListener("load", function()
{
setTimeout(updateLayout, 0);
}, false);
var currentWidth = 0;
function updateLayout()
{
if (window.innerWidth != currentWidth)
{
currentWidth = window.innerWidth;
var orient = currentWidth == 320 ? "profile" : "landscape";
document.body.setAttribute("orient", orient);
setTimeout(function()
{
window.scrollTo(0, 1);
}, 100);
}
}
setInterval(updateLayout, 100);
</script>
<link media="only screen and (max-device-width: 320px)" href="style.css" …Run Code Online (Sandbox Code Playgroud) 我需要访问使用JavaScript的HTML文件中的元素,他们的名字都一样arr_1,arr_2,arr_3,我想用一个循环动态创建ID,然后访问它们象下面这样:
for(var i=0; i< 10; i++) {
var id = "arr_" + i;
$document.getElementById('id')....
}
Run Code Online (Sandbox Code Playgroud)
但它不起作用.我记得有一个功能允许我这样做,任何人都知道那是什么?