Results 1 to 3 of 3

Thread: What is the difference between position() and offset() in jQuery?

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2019
    Posts
    44

    What is the difference between position() and offset() in jQuery?

    What is the difference between position() and offset() in jQuery?

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,274

    Re: What is the difference between position() and offset() in jQuery?

    This was the second result in a web search for jquery position offset:

    https://stackoverflow.com/questions/...ion-and-offset

    It took me a few seconds to find it. It would have taken you no longer. You ought to learn how to use a search engine.

  3. #3
    Banned
    Join Date
    Jan 2021
    Location
    USA
    Posts
    25

    Re: What is the difference between position() and offset() in jQuery?

    Although jQuery offset() and position() are similar in nature there are having some differences. The offset() method retrieves the current position relative to the document, whereas the position() method retrieves the position relative to the parent element. The offset() method provides two methods: to set or return the offset co-ordinates for the selected elements relative to the document. The jQuery position() method returns the object with two properties: top and left position in pixels.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width