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 NowNext TopicjQuery addClass() |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India