Click to See Complete Forum and Search --> : newb - help for floating menu


stsintzo
02-21-2003, 03:37 PM
Here's the script i have for a floating menu but I don't know much about javascript, the current script makes my floating menu stay to the top left of my page but i want it to be in the middle of the page on the left ... centered so it can look nice. can anyone help me make the seemingly simple fixes please ??
SCRIPT:
============================================
part 1
============================================
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function setVariables() {
if (navigator.appName == "Netscape") {
v=".top=";
dS="document.";
sD="";
y="window.pageYOffset";
}
else {
v=".pixelTop=";
dS="";
sD=".style";
y="document.body.scrollTop";
}
}
function checkLocation() {
object="floating";
yy=eval(y);
eval(dS+object+sD+v+yy);
setTimeout("checkLocation()",10);
}
// End -->
</script>
============================================Part 2
============================================
<!-- A1 --><BODY OnLoad="setVariables();checkLocation()"><!-- -->
============================================part 3
============================================<!--A1 -->
<div id="floating" style="position:absolute; visibility:show; left:0px; width:162px; height:305px; z-index:2; left: 0; top: 200">

My menu goes here ....

</div><!-- -->

pyro
02-21-2003, 10:16 PM
All you do is change the left=0 value in the div tag, something like this:

<div id="floating" style="position:absolute; visibility:show; left:0px; width:162px; height:305px; z-index:2; left: 400; top: 200">