手机
当前位置:查字典教程网 >编程开发 >Javascript教程 >jQuery获得document和window对象宽度和高度的方法
jQuery获得document和window对象宽度和高度的方法
摘要:本文实例讲述了jQuery获得document和window对象宽度和高度的方法。分享给大家供大家参考。具体如下:$(document).r...

本文实例讲述了jQuery获得document和window对象宽度和高度的方法。分享给大家供大家参考。具体如下:

<!DOCTYPE html> <html> <head> <script src="js/jquery.min.js"> </script> <script> $(document).ready(function(){ $("button").click(function(){ var txt=""; txt+="Document width/height: " + $(document).width(); txt+="x" + $(document).height() + "n"; txt+="Window width/height: " + $(window).width(); txt+="x" + $(window).height(); alert(txt); }); }); </script> </head> <body> <button>Display dimensions of document and window</button> </body> </html>

希望本文所述对大家的jQuery程序设计有所帮助。

【jQuery获得document和window对象宽度和高度的方法】相关文章:

JQuery自动触发事件的方法

jQuery仿gmail实现fixed布局的方法

JS或jQuery获取ASP.NET服务器控件ID的方法

jquery实现图片左右切换的方法

JQuery控制Radio选中方法分析

JS/Jquery判断对象为空的方法

js获取页面description的方法

jQuery实现dialog设置focus焦点的方法

jQuery获得字体颜色16位码的方法

jQuery实现首页图片淡入淡出效果的方法

精品推荐
分类导航