當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. 隱藏HTML
- 2. 隱藏從通過方法iPhone
- 3. 隱藏代碼隱藏的HTML屬性
- 4. 隱藏()在ember.js圖像的方向
- 5. 鍵盤在方向更改時隱藏
- 6. 方向工具提示隱藏
- 7. 鍵盤隱藏方向變化
- 8. 隱藏在HTML/CSS
- 9. 隱藏html元素
- 10. HTML - DIV不隱藏
- 11. Javascript隱藏DIV HTML
- 12. 隱藏HTML表列
- 13. 方法隱藏
- 14. iphone - uiactivityindicatorview並不隱藏
- 15. 隱藏鍵盤iphone sdk?
- 16. 隱藏點,MonoTouch的iphone
- 17. 如何隱藏在iphone
- 18. 隱藏iPhone上的鍵盤
- 19. 在iPhone上隱藏/顯示NavigationBar旋轉導致迷失方向NavigationBar
- 20. 溢出隱藏隱藏在一個方向全貌,而不是其他
- 21. HTML:防止隱藏選項
- 22. 隱藏GET請求html/php
- 23. 如何隱藏HTML標籤?
- 24. 隱藏html頁面源碼
- 25. 隱藏鏈接在html
- 26. HTML <applet>隱藏PARAMS
- 27. 如何隱藏html div
- 28. HTML幫助 - 隱藏按鈕
- 29. 貝寶隱藏html代碼
- 30. Html,CSS,php隱藏分區
一個我自己的,[以前的問題( http://stackoverflow.com/questions/2323281/can-js-jquery-determine-the-orientation-of-the-iphone),可能值得快速閱讀。 – 2010-12-07 01:37:28