国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 語言 > JavaScript > 正文

jQuery獲得document和window對象寬度和高度的方法

2024-05-06 16:17:37
字體:
來源:轉載
供稿:網友

這篇文章主要介紹了jQuery獲得document和window對象寬度和高度的方法,涉及jQuery獲取document和window對象屬性的技巧,具有一定參考借鑒價值,需要的朋友可以參考下

本文實例講述了jQuery獲得document和window對象寬度和高度的方法。分享給大家供大家參考。具體如下:

 

 
  1. <!DOCTYPE html> 
  2. <html> 
  3. <head> 
  4. <script src="js/jquery.min.js"> 
  5. </script> 
  6. <script> 
  7. $(document).ready(function(){ 
  8. $("button").click(function(){ 
  9. var txt=""
  10. txt+="Document width/height: " + $(document).width(); 
  11. txt+="x" + $(document).height() + "/n"; 
  12. txt+="Window width/height: " + $(window).width(); 
  13. txt+="x" + $(window).height(); 
  14. alert(txt); 
  15. }); 
  16. }); 
  17. </script> 
  18. </head> 
  19. <body> 
  20. <button>Display dimensions of document and window</button> 
  21. </body> 
  22. </html> 

希望本文所述對大家的jQuery程序設計有所幫助。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表

圖片精選

主站蜘蛛池模板: 敦化市| 惠东县| 清涧县| 公安县| 潞城市| 耒阳市| 革吉县| 郧西县| 东宁县| 于都县| 开封县| 盘锦市| 五原县| 积石山| 乌什县| 会泽县| 永仁县| 河间市| 修水县| 安溪县| 略阳县| 桃园县| 新巴尔虎右旗| 扬中市| 湘乡市| 金堂县| 奉贤区| 上犹县| 原阳县| 成都市| 宁安市| 保亭| 景东| 新兴县| 鹰潭市| 石狮市| 都匀市| 彭阳县| 峨山| 大英县| 嘉禾县|