Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > HTML > HTML Code Clinic
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 30th, 2004, 08:50 AM
Authorized User
 
Join Date: Feb 2004
Location: , , .
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

Reply With Quote
  #2 (permalink)  
Old May 30th, 2004, 12:49 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Copenhagen, , Denmark.
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.

Reply With Quote
  #3 (permalink)  
Old May 30th, 2004, 10:01 PM
Authorized User
 
Join Date: Feb 2004
Location: , , .
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

Reply With Quote
  #4 (permalink)  
Old May 31st, 2004, 02:02 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Copenhagen, , Denmark.
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.

Reply With Quote
  #5 (permalink)  
Old May 31st, 2004, 02:27 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Copenhagen, , Denmark.
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.

Reply With Quote
  #6 (permalink)  
Old May 31st, 2004, 04:08 PM
Authorized User
 
Join Date: Feb 2004
Location: , , .
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?

Reply With Quote
  #7 (permalink)  
Old May 31st, 2004, 04:09 PM
Friend of Wrox
 
Join Date: Nov 2003
Location: , , .
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

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

Snib

<><
Reply With Quote
  #8 (permalink)  
Old May 31st, 2004, 04:25 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Copenhagen, , Denmark.
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.
Reply With Quote
  #9 (permalink)  
Old June 1st, 2004, 02:05 PM
Authorized User
 
Join Date: Feb 2004
Location: , , .
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

Reply With Quote
  #10 (permalink)  
Old June 1st, 2004, 03:08 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Copenhagen, , Denmark.
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

Jacob.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 12:36 AM.


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