JQuery  Dimensions

please click here for more wordpress cource

jQuery provides several methods to get or set the dimensions of HTML elements. Here are some of the most commonly used methods:

  1. width(): This method returns the current computed width of the first element in the matched set or sets the width of all elements in the matched set.
  2. height(): This method returns the current computed height of the first element in the matched set or sets the height of all elements in the matched set.
  3. innerWidth(): This method returns the current computed width of the first element in the matched set including padding but not border or margin.
  4. innerHeight(): This method returns the current computed height of the first element in the matched set including padding but not border or margin.
  5. outerWidth(): This method returns the current computed width of the first element in the matched set including padding and border but not margin.
  6. outerHeight(): This method returns the current computed height of the first element in the matched set including padding and border but not margin.

All of these methods can also take an optional Boolean parameter, includeMargin, which when set to true, includes the element’s margin in the calculation. For example, outerWidth(true) will return the outer width of the first element in the matched set including padding, border, and margin.

You may also like...

Popular Posts

Leave a Reply

Your email address will not be published. Required fields are marked *