Click to See Complete Forum and Search --> : javascript floating menu


dotted line
07-26-2003, 03:50 PM
I am trying to modify a floating menu script. It stays x pixels from the left of the page and y pixels from the top. It scrolls with the page and always stays at those coordinates.

My problem is when the window size becomes really tiny (at 800x600 not full screened) it covers up the image in the bottom left hand corner. I want the menu to be bumped up when it hits the corner image (203px from bottom).

I am not a js master and I need someone who can help me out. From people I've talked to it doesn't seem that difficult to do but I haven't had any luck yet. Please help me out if you can.

To get an idea of what I'm talking about visit http://www.dentalassociatespa.com/salesianum.org/thing.htm.

arturion
08-22-2003, 07:32 PM
You should try to give a different size to the image depending of the resolution of the users's screen

this works in internet explorer
<head>
<script languaje="javascript">
<!--
if(screen.height==800 && screen.width==640){
image_height=200;
image_width=200;
}
if(screen.height==1024 && screen.width==768){
image_height=400;
image_width=400;
}
-->
</script>

<body>
<div id="layer_1">
<img src="yourimage.gif" width=image_width height="image_height">
</div>


so,the image has a different size depending on the resolution of the client

I hope it will be useul to you

bye

AdamBrill
08-22-2003, 10:39 PM
I don't know if that is what you wanted or not, but arturion's obviously untested code won't work right. Try this:<script type="text/javascript">
<!--
if(screen.height<=800){
document.write('<img src="yourimage.gif" border=1 width="200" height="200">');
}else{
document.write('<img src="yourimage.gif" border=1 width="400" height="400">');
}
-->
</script>