Layout Options

  • Fixed Header
    Makes the header top fixed, always visible!
  • Fixed Sidebar
    Makes the sidebar left fixed, always visible!
Introduction
Webconcept

Description

The .position() method returns the position of the first selected element, relative to the parent element

This method returns an object with 2 properties, top and left, which represent the top and left positions in pixels.


v1.2

This method has the form:

.position()

Return Value

This form returns an Object.

Examples

Get the current position of a p element:

$("button").click(function(){
  x=$("p").position();
  alert("Left position: " + x.left + " Top position: " + x.top);
});