PDA

View Full Version : center foldout menu


P3x
10-30-2003, 07:58 AM
Hello, I have downloaded a script from DHTMLcentral. It's a foldout menu and it does not center on the page.
(I tried getting help at DHTMLcentral, but did not get it...)

Since I need it to center I tried to code that, but I don't get it to work. I have tried numerous things and Im stuck. I hope someone can help me out with this. I will attach the complete script.

So the problem is that I want to center the foldout menu (even when a user resizes the window).

Thanks in advance for any help,

P3x

P3x
10-30-2003, 08:02 AM
Attachment should be here,

P3x

piglet
10-30-2003, 08:13 AM
Hi,

The first error I see is that you have:

FoldNumber = 6

When you only have divSubn from 0 to 4.

That causes an error stopping the script from completing.

Change it to:

FoldNumber = 5

and the script will work...

piglet
10-30-2003, 08:22 AM
ps. Centering...

The div containing the menu is position:absolute; - ie stuck at left:50px; top:70px;.

If you want to center the div you just need to change its top and left on page load or change of window size.

There's a demo of how to do that sort of thing here (http://www.webxpertz.net/forums/showthread.php3?s=&threadid=26562) - you just get the width using the equivalent function.

However, having said that...the script doesn't appear to work in netscape 6+ properly...so it's perhaps not the best script to use.....

P3x
10-30-2003, 09:04 AM
However, having said that...the script doesn't appear to work in netscape 6+ properly...so it's perhaps not the best script to use.....

Could you tell me where I could find a better script?

P3x

piglet
10-30-2003, 09:09 AM
Hi,

Dynamic Drive (http://www.dynamicdrive.com/dynamicindex1/index.html) have a large selection of great menus - well worth a look...