jQuery Tutorials
jQuery Effects
jQuery HTML
jQuery Traversing
jQuery AJAX
jQuery Misc
With jQuery, it is easy to work with the size of the elements and the browser window.
jQuery has several important methods for working with dimensions:
width()
height()
innerWidth()
innerHeight()
innerHeight()
outerWidth()
outerHeight()
Width()
method sets or returns the width of an item (excludes folds, borders and margins).
Height()
method sets or returns the length of an item (excludes pads, borders and margins).
The following example returns the width and length of the specified <div>
feature:
The innerWidth()
method returns the width of the element (including the end).
The innerHeight()
method returns the length of the element (including the ending).
The following example returns the internal width / length of the specified <div>
feature:
The outerWidth()
method returns the width of the element (including the end and the border).
The outerHeight()
method returns the length of an object (includes termination and boundary).
The following example returns the width / length of something
The outerWidth(true)
method returns the width of the element (including pad, border, and genes).
The outerHeight(true)
returns the length of an object (including pads, border, and genes).
The following example returns the width and length of the document (HTML document) and window (browser lookup):
The following example sets the width and length of the specified <div>
feature: