Click to See Complete Forum and Search --> : Inconsistent results during image zoom


olerag
07-31-2003, 01:59 PM
Zoom 1. The following code, using a JS function (zoom), will
depict the desired results in either IE6 or NN7, but not NN4.7x.
Probably due to the "getElementById" function.

<html>
<head>
<script type="text/javascript">
function zoom() {
var vDiv = document.getElementById('imgDiv');
vDiv.style.left = -121;
vDiv.style.top = -153;
}
</script>
</head>
<body onLoad="zoom()";>
<center>
<b>Image Test</b>
<p>
<img border=1 src="image1.gif">
<p>
<div style="width:128; height:117; overflow:hidden; border:solid black 1px;">
<div id=imgDiv style="position:relative;"><img src="image1.gif">
</div>
</div>
</center>
</body>
<html>

Zoom 2. To make the code function for all browsers
previously mentioned, I attempted the same function with
straight HTML. For whatever reason, only IE6 works as
desired.

<html>
<head>
</head>
<body>
<center>
<b>Image Test</b>
<p>
<img border=1 src="image1.gif">
<p>
<div style="width:128; height=117; overflow:hidden; border:solid black 1px;">
<div style="position:relative; left:-121; top:-153;"><img src="image1.gif">
</div>
</div>
</center>
</body>
<html>

Question 1. If this is not the best way to perform this type
of function, I'm open to any better suggestions?

Question 2. I do not understand why neither version of
Netscape functions with example #2, above. Can anyone
provide some insight as to why this is??

Thanx for any ideas/suggestions/corrections....