Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > HTML > HTML Code Clinic
|
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the HTML Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 30th, 2004, 08:50 AM
Authorized User
 
Join Date: Feb 2004
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
Default menu positioning problem

Hi,

I am working on a website which is under construction.


http://test420.biz/

See that javascript menu on top. I download it from Dynamic drive website. The poitioning of that menu is by distance from left and top in pixeles in javascript, just like we do sometime in <DIV>.

addmenu(menu=[ // This is the array that contains your menu properties
"mainmenu", //Menu Name
140, // Menu Top position in pixels-
525, //Menu Left position in pixels


My table is align center. Right now everything looks nice and pretty if you have same monitor size and resloution like I have. If I change the resolution then you will see that menu does not remain part of the page but infact its poition changes...

How can I fix that problem.

Thanks

 
Old May 30th, 2004, 12:49 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I do not quite get it! I think it works as you have told it to. When I open the site it is always positioned 140 (top) 525 (left); i.e. also when I resize the window. However if you do this it will not follow the other elements on the page. Since you are using tables you should place the menu inside the table, right?

Jacob.

 
Old May 30th, 2004, 10:01 PM
Authorized User
 
Join Date: Feb 2004
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for your reply. Idealy if the menu is in table then there will be no problem. Menu will change position accordingly. But almost al the menues are written in javascript, and they are separate from your table, and you have to give them position on the page, by Left and Top pixel poistion. Thats the problem I am having, becuse menus poition is fixed Top (140) and left (525) and other other page position changes when either resloution or screen size changes....
I don't know what I can do about it..

Thanks

 
Old May 31st, 2004, 02:02 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I know what you mean since I have had the same issue with one of my sites. The way I solved it was to trace down the place where the JS actually writes the menu, and then put it where I would like it to be.

It looks like it is in the file menu_array.js or mmenu.js.

Jacob.

 
Old May 31st, 2004, 02:27 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I briefly looked at the script, and found that it is probably the dumpmenus function that writes the menu, however it looks like the guy who wrote the script has actually hardcoded that the menu should be positioned 'absolute'.

Since I am no CSS position wizard I cannot help you in this area. Sorry.

Jacob.

 
Old May 31st, 2004, 04:08 PM
Authorized User
 
Join Date: Feb 2004
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for you message. You are right you need to hardcode the menu position. I know you can find the resolution of client screen using javascript , it it possible to do by ASP?

 
Old May 31st, 2004, 04:09 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

You cannot with ASP AFAIK. Why not just use JavaScript?

Snib

<><
 
Old May 31st, 2004, 04:25 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think that if I were you I would introduce a variable in the menu_array.js file, which allows you to toggle between relative and absolute, and then change the script found in the mmenu.js file. This way you get greater flexibility and you get change to go through the code and see what is going on.

Naturally you have to make sure that it is OK with the author, and perhaps even send him the improvement. ;)

Jacob.
 
Old June 1st, 2004, 02:05 PM
Authorized User
 
Join Date: Feb 2004
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,
Menu code is long and quite complicated to change, atleast for me quite complicated. What I did , which is working so far, I get the resolution and then I have put an if statemnt in the mmenu.js, in that if statement i have different menu left positions for different resolutions.

I am only having problem in AOL. I need to find out javascript that works on AOL and gives me the inner width of the screen, because AOL browser have there own menus on the left side, which reduced the actuall avaliable screen.

Thanks

 
Old June 1st, 2004, 03:08 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

But don't you have a problem when you resize the window!?

Jacob.





Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with my menu in ie6 johnficca CSS Cascading Style Sheets 1 May 6th, 2007 07:41 PM
Positioning Problem in Firefox and Netscape echovue Javascript 3 April 13th, 2007 08:39 AM
Positioning Problem harpua CSS Cascading Style Sheets 5 May 27th, 2005 08:03 AM
menu positioning problem isheikh Wrox Book Feedback 1 May 30th, 2004 12:39 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.