Click to See Complete Forum and Search --> : floating menu script - please help


stsintzo
03-01-2003, 12:34 PM
hi - heres part a script i'm using to create a floating menu on the left of my webpage. The only problem is when i check my webpage at 800*600 res - it shifts my menu to an "undesired" position covering part of my top banner, i was hoping someone could help me construct an if statement in here to check the resolution of the users screen and then make a decision on which starting point to use. i've highlighted where i think the conditional statement should go (cause its the only part ive changed to move the layer up/down the screen). Thanks for any help ...
---------------------------------------------
<script type="text/javascript">

var verticalpos="frombottom"

if (!document.layers)
document.write('</div>')

function JSFX_FloatTopDiv()
{
var startX = 0,
startY = 400;
var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;
function ml(id)
{

pyro
03-01-2003, 12:51 PM
How about:

<script type="text/javascript">

var verticalpos="frombottom"

if (!document.layers)
document.write('</div>')

function JSFX_FloatTopDiv()
{
var startX = 0,
if (screen.width <= 800)
{
startY = 400; //800x600 or less
}
else
{
startY = 400; //greater than 800x600
}
var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;
function ml(id)
{

stsintzo
03-01-2003, 07:24 PM
is there any way to alter this code to compensate for when the user i not maximizing the browser ? reason i ask is that - now my floating menu works perfectly EXCEPT for when the browser is not maximized ... meaning, if i adjust the size of the browser, the position is relative to the bottom of the browser screen (i think) and so the floating menu then flys up out of view ... what i would like it to do is set a boundary, so that once it reaches a certain point it can no longer go any higher. am i making any sense?

pyro
03-01-2003, 08:04 PM
If I am understanding you correctly, you want to set it based on the size of the browser, rather than the screen res, now? Is that correct? If so you will need the following commands:

window.innerWidth //netscape
document.body.clientWidth //Internet Explorer

Those will give you the width of the browser window.

stsintzo
03-01-2003, 08:33 PM
is there any way i can just set a boundary on how far up it travels thus keeping it within the screen range ?

pyro
03-01-2003, 10:17 PM
Well, I'd say that depends on your code... ;) A link or some code would be nice...