I have discovered by experiment that element.style.top 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.
Expand|Select|Wrap|Line Numbers
- 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)