For example, I want to draw submenu while its parent item is a <span> element. Can I determine the <span>‘s dimensions and location on the fly?
For example, I want to draw submenu while its parent item is a <span>
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
jQuery provides a convenient way to get the dimensions or position of any element.
will get you the location of the element, where you can then use
topandleft, andwill get you the element’s width.
height()acts the same way.