开发者

window.orientation is not working in UIWebView

I am using 3.2 and 4.0 iOs and I am trying to run html file in UIWebView. the开发者_如何学C html file contains to following lines:

var pwint = function(text) {
 var output = document.getElementById('output');
 output.innerHTML = output.innerHTML + text + '\n';
};

var reorient = function(e) {
 pwint('Window Orientation: ' + window.orientation); 
};

window.onorientationchange = reorient

The problem is that window.orientation always returns '0' while I run the same code in safari it works as expected.

any ideas?


Try applying it to document.body.onorientationchange.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜