国产探花免费观看_亚洲丰满少妇自慰呻吟_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程序設計有所幫助。

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

圖片精選

主站蜘蛛池模板: 龙陵县| 长泰县| 浦东新区| 称多县| 林周县| 南皮县| 子长县| 荣成市| 乐陵市| 英超| 双峰县| 外汇| 德阳市| 黄山市| 栾川县| 镇安县| 积石山| 新安县| 义乌市| 固安县| 织金县| 隆回县| 清流县| 巴中市| 保定市| 监利县| 尉犁县| 平阳县| 禹城市| 双城市| 砀山县| 临武县| 鄂伦春自治旗| 东兰县| 祁阳县| 邮箱| 丽水市| 仁布县| 额济纳旗| 岱山县| 哈尔滨市|