[Javascript] Re: Portable Menu

Andrew Gibson andyg at ihug.co.nz
Wed May 15 16:14:57 CDT 2002


> I downloaded the javascript from
> http://javascript.internet.com/navigation/portable-menu.html
>
> As the visitor scrolls up and down your site, the menu moves up and down
> with them.
>
> The problem is it looks like it can only be top/left aligned. I want a
> bottom/right postion.
>
> Any scripts out there that can do this?

You'd need to calculate where you want the new menu postioned after a
scroll.

Right, would be straightforward I guess?

something like

var menuWidth=100   //menu width
var scrWidth=document.body.offsetWidth
document.getElementById("myMenu").style.left=scrWidth-menuWidth

The Bottom bit is a bit more tricky I think.

You'd need to look into something like

document.body.scrollTop  which only works for IE I think.

to get the height of the scroll.

Andrew









More information about the Javascript mailing list