pav
9/12/2013 - 2:26 PM

Two more useful methods that change the appearance of an element on the page are height() and width(). They are both getters, but will act

Two more useful methods that change the appearance of an element on the page are height() and width().

They are both getters, but will act as a setter if provided with an argument. Passing an integer, like $element.height(50) will set the height to 50 pixels (pixels are the default unit).

It is possible to specify another unit of measurement by passing a string.

function rotate($that) {
    //swap the height and width attributes
    //of $that using .height and .width;
    $that.height($that.weight());
    $that.width($that.height());
}