91-9990449935 0120-4256464 |
jQuery position()The jQuery position () method makes you able to retrieve the current position of an element relative to the parent element. It returns the position of the first matched element. This method returns the object with two properties: top and left position in pixels. The jQuery position() method is different from jQuery offset() method because the position() method retrieves the current position of an element relative to the parent element while the offset() method retrieves the current position relative to the document.The position() method is more useful when you want to position a new element near another one within the same containing DOM element.Syntax: Example of jQuery position() methodLet's take an example to demonstrate the jQuery position() method. Test it NowAnother example of jQuery position()Test it Now
Next TopicjQuery addClass()
|