Dave Laurie
11-02-2004, 10:32 PM
Hello there,
I have inherited a script and not really being a wizard with js, I can't tell if I am up against a browser bug or bad coding. This script works fine in mozilla, moving some content down the left side of the page, acting like a scrolling nav bar. There is no function in IE.
The script:
function slideMenu () {currentY = null;
if (window.innerHeight) {currentY=window.pageYOffset}
else if (document.body) {currentY=document.body.scrollTop}
else {return null}
var menuObjStyle = document.getElementById("leftcontent").style
menuObjStyle.top = (currentY+115)+"px";
// var tmp = parseInt(menuObjStyle.top) + parseInt((currentY-parseInt(menuObjStyle.top))/4)+120
window.status=currentY
// if (isNaN(tmp)) {menuObjStyle.top="500px"}
// else {menuObjStyle.top = tmp}
slideMenuTimerId = setTimeout("slideMenu()",900);
}
window.onload=slideMenu;
I'm hoping someone can tell me if IE uses different syntax or identifiers to catch the browser window boundaries.
Cheers,
Dave
I have inherited a script and not really being a wizard with js, I can't tell if I am up against a browser bug or bad coding. This script works fine in mozilla, moving some content down the left side of the page, acting like a scrolling nav bar. There is no function in IE.
The script:
function slideMenu () {currentY = null;
if (window.innerHeight) {currentY=window.pageYOffset}
else if (document.body) {currentY=document.body.scrollTop}
else {return null}
var menuObjStyle = document.getElementById("leftcontent").style
menuObjStyle.top = (currentY+115)+"px";
// var tmp = parseInt(menuObjStyle.top) + parseInt((currentY-parseInt(menuObjStyle.top))/4)+120
window.status=currentY
// if (isNaN(tmp)) {menuObjStyle.top="500px"}
// else {menuObjStyle.top = tmp}
slideMenuTimerId = setTimeout("slideMenu()",900);
}
window.onload=slideMenu;
I'm hoping someone can tell me if IE uses different syntax or identifiers to catch the browser window boundaries.
Cheers,
Dave