Sorry, I have found my mistake, but I cannot delete this post.
I have discovered by experiment that element.style.t op assignment in IE works with just a number on the right but in Firefox you have to put the unit too. Original code is below. Adding "+'px'" made it work in Firefox too.
alert results IE: 162; -2; 162px (div moves)
alert results Firefox 2: 162; 0; blank (div doesn't move)
I have discovered by experiment that element.style.t op assignment in IE works with just a number on the right but in Firefox you have to put the unit too. Original code is below. Adding "+'px'" made it work in Firefox too.
Code:
javascript
var fullsizeimage = document.getElementById('fullsizeimageframe');
if (!fullsizeimage) return false;
var coord = new Array(2);
coord = findPos(whichpic);
alert(coord[1]);
alert(fullsizeimage.offsetTop);
document.getElementById('fullsizeimageframe').style.top = coord[1];
alert(fullsizeimage.style.top);
.....
alert results Firefox 2: 162; 0; blank (div doesn't move)
Comment