Hi all, please help...
I need to make an image float vertically as users scroll thru the page. Which wouldn't be a problem if I had one image with the fixed height.
In my project I have different images with different heights on the different pages of the site. The only thing which doesn't change is the lower rim of all the images with the Y coordinate = baseBottom. So I have to calculate the top scroll coordinate for every image by subtracting imgHeight from the baseBottom.
How do I access the height property of the image with the Xbrowsing in mind(N4,IE5+,N6+)?
I think the problem is in the pass I follow to access the image height in order to store it in the imgHeight variable. I think I am able to script the rest for the scrolling part of the image on my own.
JS file:
if (nav4) {
imgHght = document.layers['flot2'].document.images['pic'].pixelHeight;
} else {
imgHght = document.getElementById("pic").pixelHeight;
}
HTML file:
<div id="flot2" style="position:absolute;height:163px;left:636px;top:130px;">
<img src=http://www.webdeveloper.com/forum/archive/index.php/"imgs/dynamic.jpg" width="112" height="163" border="0" id="pic">
</div>
Thanks for your time, Eugene.
I need to make an image float vertically as users scroll thru the page. Which wouldn't be a problem if I had one image with the fixed height.
In my project I have different images with different heights on the different pages of the site. The only thing which doesn't change is the lower rim of all the images with the Y coordinate = baseBottom. So I have to calculate the top scroll coordinate for every image by subtracting imgHeight from the baseBottom.
How do I access the height property of the image with the Xbrowsing in mind(N4,IE5+,N6+)?
I think the problem is in the pass I follow to access the image height in order to store it in the imgHeight variable. I think I am able to script the rest for the scrolling part of the image on my own.
JS file:
if (nav4) {
imgHght = document.layers['flot2'].document.images['pic'].pixelHeight;
} else {
imgHght = document.getElementById("pic").pixelHeight;
}
HTML file:
<div id="flot2" style="position:absolute;height:163px;left:636px;top:130px;">
<img src=http://www.webdeveloper.com/forum/archive/index.php/"imgs/dynamic.jpg" width="112" height="163" border="0" id="pic">
</div>
Thanks for your time, Eugene.