HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
jQuery HTML/CSS Methods : Return the offset coordinates of a <p> element
The offset() method set or returns the offset coordinates for the selected elements, relative to the document.
Return the offset coordinates:
Set the offset coordinates:
Set offset coordinates using a function:
Parameter | Description |
---|---|
{top:value,left:value} | Required when setting the offset. Specifies the top and left coordinates in pixels. Possible values:
|
function(index,currentoffset) | Optional. Specifies a function that returns an object containing the top and left coordinates
|