I am writing a little javascript snippet that reads through all the image tags on a page and then overlays a div on them.
I am grabbing the image height and width properties to set the div height and width. The issue I am having is with a tabbed area. A div that is hidden/unhidden depending on a clicked link. I am unable to get the properties of images inside the hidden div. My code finds the img object, but not the properties associated with it.
Code:
myBodyElements = myBody.getElementsByTagNam
e("img");
for (i=0; i<=myBodyElements.length-1
; i++)
{
myP = myBodyElements[i];
img_height=myP.Height; <--returns 0 for the hidden div.
img_width=myP.Width; <--returns 0 for the hidden div.
}
Start Free Trial