Click to See Complete Forum and Search --> : scrolling images/Xbrowser issues


eugenet
03-02-2003, 02:49 PM
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="imgs/dynamic.jpg" width="112" height="163" border="0" id="pic">
</div>

Thanks for your time, Eugene.

gil davis
03-02-2003, 03:53 PM
Originally posted by eugenet
if (nav4) {
imgHght =
document.layers['flot2'].document.images['pic'].pixelHeight;Should be:

imgHght = document.layers['flot2'].document.images['pic'].height;

eugenet
03-02-2003, 06:53 PM
I changed both pixelHeight to height.
It still doesn't work...

gil davis
03-02-2003, 07:23 PM
Originally posted by eugenet
I changed both pixelHeight to height.
It still doesn't work... That change was only for NS 4.

You must have something else wrong. Post a link.