Documentation

Plugins/dimensions

From jQuery JavaScript Library

Jump to: navigation, search

Contents

Overview

Dimensions extends jQuery to provide cross-browser methods for getting the position, inner width and height, outer width and height, and more.

Browser Support

Dimensions is tested in those browsers that jQuery supports. See browser compatibility for more info.

Depends On

Dimensions 1.2 depends on jQuery 1.2+.

License

Dimensions is Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. Copyright (c) 2007 Paul Bakaus and Brandon Aaron (http://brandonaaron.net).

API Documentation

NameType
width and height:






NameType
innerHeight( ) Returns: Integer
Gets the inner height (excludes the border and includes the padding) for the first matched element.
innerWidth( ) Returns: Integer
Gets the inner width (excludes the border and includes the padding) for the first matched element.
outerHeight( options ) Returns: Integer
Gets the outer height (includes the border and padding by default) for the first matched element.
outerWidth( options ) Returns: Integer
Gets the outer width (includes the border and padding by default) for the first matched element.
scroll:


NameType
scrollLeft( ) Returns: Integer
Gets the scroll left offset of the first matched element.
scrollLeft( offset ) Returns: jQuery
Sets the scroll left offset.
scrollTop( ) Returns: Integer
Gets the scroll top offset of the first matched element.
scrollTop( offset ) Returns: jQuery
Sets the scroll top offset.
offsets:


NameType
position( ) Returns: Object
Gets the top and left position of an element relative to its offset parent.
offsetParent( ) Returns: jQuery
Gets the positioned parent of the first matched element.


Download

The latest release can be downloaded from the Dimensions project page.

Or you can live on the edge and just pull from SVN: http://jqueryjs.googlecode.com/svn/trunk/plugins/dimensions/


Support

You can report a bug, request a feature, submit a patch or request support from the Dimensions project page.