我有表单页面HTML5
。页面太大所以我加了一个滚动条:jquery.nicescroll
<div>
我用iPhone 4包装表单height:480px
并运行niceScroll
构造函数。
<div id = "scroller">
<form>
..
...
......
</form>
</div>
<script>
$('#scroller').niceScroll();
</script>
它工作正常,但问题是我应该给每个设备他自己的高度:(height-40px)所以它在设备上看起来不错。例如:iPhone4 高度:480px,iPhone5:568px,Samsung S2 533 等。
检查设备高度值的最佳方法是什么,以便之后我可以使用它?现在我可以通过以下方式检查设备公司userAgent
:
navigator.userAgent.indexOf("iPhone")
但我需要确切地知道模型