Extends the Element native object to include the pin method useful for fixed positioning for elements.

Tutorial/Demo

Affixes an element at its current position, even if the window is scrolled.

Arguments

  1. pin - (boolean, optional) true: pins the element; false: unpins the element; defaults to true; See also Element:unpin.

Syntax

$('myElement').pin();

Returns

  • (element) This Element.

Un-pins an element at its current position (see Element:pin).

Syntax

$('myElement').unpin();

Returns

  • (element) This Element.

Toggles the pin state of the element.

Syntax

$('myElement').togglePin();

Returns

  • (element) This Element.