當iPhone更改爲肖像模式時,是否有使用JavaScript隱藏div元素的方法?iPhone方向HTML隱藏
0
A
回答
0
1
@media all and (orientation:portrait){
#divID {
display: none;
}
}
流行音樂,在你的CSS ;-)
0
你可以做一個可愛的小JS 「絕招」:
var elem = document.getElementById('elemID');
window.onorientationchange = function(){
if(document.body.offsetWidth == 960){ //don't remember the best way to retrieve body width atm
elem.style.display = "none";
}else{
elem.style.display = "block";
}
}
相關問題
- 1. jQuery顯示/隱藏方向
- 2. javascript。隱藏方向更改
- 3. asp.net隱藏着方向URL重定向
- 4. 隱藏從通過方法iPhone
- 5. 隱藏HTML
- 6. 隱藏HTML
- 7. html src隱藏
- 8. Zend隱藏的元素:隱藏html值
- 9. 隱藏代碼隱藏的HTML屬性
- 10. 對象隱藏方向更改
- 11. 方向工具提示隱藏
- 12. 鍵盤隱藏方向變化
- 13. 用hide隱藏元素時的方向()
- 14. 隱藏()在ember.js圖像的方向
- 15. 隱藏獲取方向在SupporMapFragment
- 16. 鍵盤在方向更改時隱藏
- 17. HTML - DIV不隱藏
- 18. Javascript隱藏DIV HTML
- 19. 隱藏HTML表列
- 20. 隱藏html元素
- 21. 隱藏在HTML/CSS
- 22. 用jquery隱藏HTML
- 23. Schema.org隱藏的HTML
- 24. 橫向隱藏UITabBar
- 25. 如何隱藏在iphone
- 26. iPhone - 鍵盤隱藏TextField
- 27. 隱藏點,MonoTouch的iphone
- 28. 如何隱藏在iphone
- 29. iphone - uiactivityindicatorview並不隱藏
- 30. IPhone TextView隱藏鍵盤
一個我自己的,[以前的問題( http://stackoverflow.com/questions/2323281/can-js-jquery-determine-the-orientation-of-the-iphone),可能值得快速閱讀。 – 2010-12-07 01:37:28