Skip to content

Latest commit

 

History

History
35 lines (26 loc) · 1.02 KB

File metadata and controls

35 lines (26 loc) · 1.02 KB

@function jQuery.dimensions jQuery.dimensions @parent jquerypp @signature jQuery.dimensions @plugin jquerypp/dom/dimensions

@body Adds support for animating and setting inner and outer dimensions. It overwrites

  • [jQuery.fn.outerHeight jQuery.fn.outerHeight(value, includeMargins)]
  • [jQuery.fn.outerWidth jQuery.fn.outerWidth(value, includeMargins)]
  • [jQuery.fn.innerHeight jQuery.fn.innerHeight(value)]
  • [jQuery.fn.innerWidth jQuery.fn.innerWidth(value)]

to let you set these properties and extends animate to animate them.

Use

When writing reusable plugins, you often want to set or animate an element's width and height that include its padding, border, or margin. This is especially important in plugins that allow custom styling.

Quick Examples

 $('#foo').outerWidth(100).innerHeight(50);
 $('#bar').animate({ outerWidth: 500 });
 $('#bar').animate({
   outerWidth: 500,
   innerHeight: 200
 });

Demo

@demo jquerypp/dom/dimensions/dimensions.html 550