View Full Version : Right hand side version of Floating Menu

03-27-2007, 01:38 AM
1) Script Title: floating menu script

2) Script URL (on DD):http://www.dynamicdrive.com/dynamicindex1/staticmenu.htm

3) Describe problem: I believe I have the latest version of this script -- it is in an external file float_menu.js

The navigation on our webpages is on the right hand side. I can get this script working with my menu, moving up and down the left hand side of the screen.

However, I'd like it on the right hand side of the screen, but dynamicaly positioned, depending on the width of the screen.

I have found that I can modify the "startX" variable to hardcode the X-axis position, but that doesn't work with different screen widths. I don't know enough about the window objects that are available to make a dynamic calculation for startX.

For my situation, I know (in pixels):
( ( (screen width) / 2 ) + 350 ) - (menu width) )
will give me a close approximation (+/- padding and margins, etc) of a position next to the left border of my right hand side menu, where 350 is half the width of my table (700px wide) centred on the screen.

Can someone help with the formula, please, particularly the "screen width" object. I can make "menu width" a variable. I'd also change the 350 to a "centre offset" variable, so this could work with any situation.

Any help will be appreciated. Thanks.


03-27-2007, 01:41 PM

04-02-2007, 10:26 PM
Thanks, John.