我有一个固定在页面底部的div(position:fixed),在普通浏览器中工作正常,但是在移动浏览器上(iphone,android,& WP7)它出现在屏幕外。如果我放大,然后缩小移动,我可以看到div重新定位到它认为底部的位置。如果有人能够快速修复或者指引我朝着正确的方向发展,那将是非常好的事情,但是我真的很关心移动浏览器如何处理坐标和桌面之间的差异。position:fixed not working on mobile,在桌面上工作
2
A
回答
3
默认移动浏览器试图欺骗渲染引擎以为浏览器窗口中有更多的像电脑一样大小。 这是必要的,因为否则大多数网页将在分辨率有限的移动设备(尤其是手机)上完全无法使用。
然而,您可以使用特殊标签来告诉HTML页面确实是为此类设备设计的,因此会禁用移动浏览器中的所有缩放和解析度虚拟化逻辑。
的东西,可以例如修正为iOS设备和Android设备的问题是增加
<meta name="viewport"
content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>
这个标签在<head>
节将让您的页面和JavaScript代码来处理真实设备的像素和屏幕尺寸。
0
定义“移动浏览器”。 Android浏览器支持它,iOS版Safari支持iOS5。
Opera mini等人可能不支持position:fixed。
你可以检查此... http://seesparkbox.com/foundry/fix_your_position_even_in_ios_4
相关问题
- 1. position:fixed not working
- 2. position:fixed not working in chrome
- 3. jquery scrollTop event on mobile not working
- 4. Anchor tag not working on mobile
- 5. position:fixed not working in Google Chrome
- 6. Room#on not working
- 7. Navbar not working mobile
- 8. RewriteEngine on - not working
- 9. HttpContext.Current.Response.Write not working on IE
- 10. Jquery on android not working
- 11. Jquery.Load on click not working
- 12. “Mobile”Bootstrap-Navbar not working
- 13. Mobile Bootstrap nav not working
- 14. incron on Raspbian not working
- 15. Replot not working on gnuplot
- 16. fields_for not working on update
- 17. HTML5 player not working on chrome
- 18. jquery mobile pagecontent beforeshow not working
- 19. javascript function on click not working
- 20. idangerous swiper not working on big monitor
- 21. videojs player not working on ipad
- 22. CSS:position:fixed not working on Windows Phone
- 23. click on mouseover function not working
- 24. UITapGestureRecognizer not working on UIView animated
- 25. move_uploaded_file in php not working on heroku
- 26. Attributed string not working on标签
- 27. Mousewheel not working on TinyScollbar jquery plugin
- 28. tidhttp get procedure not working on urls
- 29. slideToggle on menu item not working
- 30. preventupfault()on keyup event not working
你的麻烦是什么手机浏览器? – laymanje
[这里](http://bradfrostweb.com/blog/mobile/fixed-position/)深入探讨了你在移动环境中可以做什么。 – Andrew
也许在这里找到答案会帮助你:http://stackoverflow.com/questions/2784889/android-web-app-positionfixed-broken – StevenGilligan