i have image tag which has id attribute. I want to show this loading image in center of specific html form(i have id of that html form). i am using jquery. i am not sure how to go for this?
<img id="loading" src="loading.gif" />
the reason to do this i can have multiple forms inside a single page. i want to show the image in center of a particular form boundary not complete page boundary
You need these jQuery methods:
offset()width()height()Some math and you can easily center the element on the form.
Notice that forms have a default width of 100%.
Check my solution: http://jsfiddle.net/3pbkV/