手机
当前位置:查字典教程网 >编程开发 >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对象宽度和高度的方法】相关文章:

js+cookies实现悬浮购物车的方法

jQuery判断指定id的对象是否存在的方法

jquery实现动态改变div宽度和高度

javascript实现Table排序的方法

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

js去除浏览器默认底图的方法

JS显示日历和天气的方法

JavaScript的document和window对象详解

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

jQuery实现控制文字内容溢出用省略号(…)表示的方法

精品推荐
分类导航