Question: What is the difference between .offset () and .position ()?
I have read some documents about this, but still I do not quite understand what the real difference between the two is. I would ask for a simple explanation on this.
My observation:
I wrote javascript code that I posted on the webpage itself (.aspx). Javascript basically sets the position of a modal popup. In this code, I used .position () to get the div position where I will place the modal popup. Now here's a twist . When I moved the javascript code to a separate js file, The.position () did not work properly, I used .offset () instead, and it worked fine.
I would ask to explain about this?
source share