Blog - Latest News

What is the difference between jquery position() and offset()?

<html> <body> <divid=”div1″style=”position:absolute; top:50px; left:50px”> <divid=”div2″> </div> </div> </body> </html> Both offset and position for body will return 0 and 0. Both offset and position for div1 will return 50 and 50. AND NOW THE INTERESTING PART Position for div2 will return top:0 and left:0 which would be relative to the parent in this case […]

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *