I have a problem with Firefox not positioning a map image properly on initialization. I think I have determined that the coordinates of the location are being created properly, but Firefox does not move the image to that location. The IE version looks like this:
Firefox leaves the thumbnail and small rectangle in the upper left corner of the window. The larger image is not positioned or clipped properly.
Here is the code I believe contains the error:
I will be happy to provide you any additional information you may need, just ask.
I appreciate any help. I have been fighting this for three weeks....
Firefox leaves the thumbnail and small rectangle in the upper left corner of the window. The larger image is not positioned or clipped properly.
Here is the code I believe contains the error:
Code:
function init() {
var imageurl=document.largepic.src;
// alert("imageurl = " + imageurl + ".");
largewidth=document.getElementById("large").offsetWidth;
// alert("Largewidth " +largewidth+ "." );
largeheight=document.getElementById("large").offsetHeight;
// alert("Largeheight " +largeheight+ "." );
thumbwidth = Math.floor(largewidth/shrinkfactor);
// alert("thumbwidth " +thumbwidth+ "." );
thumbheight = Math.floor(largeheight/shrinkfactor);
document.getElementById("thumb").innerHTML="<IMG NAME='thumbpic' SRC='"+imageurl+"' width="+thumbwidth+" height="+thumbheight+">";
// alert("Thumb innerhtml = " + document.getElementById("thumb").innerHTML + "." );
document.getElementById("dragimg").innerHTML="<IMG NAME='dragimgpic' border=2 SRC='dragimg.gif' width="+dragimgwidth+" height="+dragimgheight+">";
// alert("dragimg innerhtml = " + document.getElementById("dragimg").innerHTML + "." );
// this is what the format is: left.top = 100 + “px”;
document.getElementById("large").style.Left=largeleft + "px";
// alert("Largeleft " +largeleft+ "." );
document.getElementById("large").style.Top=largetop + "px";
// alert("Largetop " +largetop+ "." );
// alert("Imagetop " +document.getElementById("large").style.Top+ "." );
document.getElementById("thumb").style.Left=thumbleft + "px";
// alert("ThumbLeft = " +document.getElementById("thumb").style.Left+ "." );
document.getElementById("thumb").style.Top=thumbtop +"px";
document.getElementById("dragimg").style.Left=dragimgleft + "px";
document.getElementById("dragimg").style.Top=dragimgtop + "px";
clippoints ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")";
// alert("Clippoints Just before = " +clippoints+ "." );
document.getElementById("large").style.clip=clippoints;
// alert("document...clip Large This = " +document.getElementById("large").style.clip+ "." );
document.getElementById("large").style.visibility="visible";
document.onmousedown = engage;
document.onmousemove = dragIt;
document.onmouseup = release;
}
if (document.addEventListener) {
document.addEventListener("DOMContentLoaded", init, false);
}
I will be happy to provide you any additional information you may need, just ask.
I appreciate any help. I have been fighting this for three weeks....