menu busts out of table on browser resize [solved]

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
User avatar
nwilcox
Mega Advanced
Mega Advanced
Posts: 269
Joined: Sat Aug 20, 2005 6:14 am
Location: Indianapolis, IN
Contact:

menu busts out of table on browser resize [solved]

Post by nwilcox »

http://www.hearthview.com/

When the homepage is resized in browser, the menu stays fixed to its original position. Is there a parameter I can set to fix this? :?

I have the height of the table set to 100% of the page so I wonder if that might be causing something to happen with the menu as well.

Thank you!
Last edited by nwilcox on Fri Aug 21, 2009 8:29 pm, edited 1 time in total.
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Just a quick thought. I believe the recommendation for tables is to load the menu scripts in the page's body, rather than the head. Try moving the <script> tags that load the base menu code and your menu_data.js file into the body... right after the opening <body> tag.

If that doesn't work, we'll try a different approach.

Kevin
User avatar
nwilcox
Mega Advanced
Mega Advanced
Posts: 269
Joined: Sat Aug 20, 2005 6:14 am
Location: Indianapolis, IN
Contact:

Post by nwilcox »

oh okay I thought we were supposed to place everything in the head tags...

I'll try that and let you know

thank yoU!
vikenk
Mega Advanced
Mega Advanced
Posts: 297
Joined: Tue Nov 29, 2005 7:38 pm

Post by vikenk »

Hello,

Well, it seems that you have the menu setup properly, even though the Scripts are placed in the HEAD. Moving them to the BODY would be preferred. I have one suggestion. I see that you've set the menu width to 481px. I think what's happening is this: When the browser window is resized smaller, the table width becomes smaller than 481px, causing the menu to pop out.

Try setting the menu width from 481px to 100%. That way it will grow and shrink with the table.

Try it out and let us know how it works.

--
Viken K.
http://www.vikenk.com
http://www.sayatnova.com
User avatar
nwilcox
Mega Advanced
Mega Advanced
Posts: 269
Joined: Sat Aug 20, 2005 6:14 am
Location: Indianapolis, IN
Contact:

Post by nwilcox »

I've placed the menu inside the body tag as suggested but it is still moving when I resize the browser :(
User avatar
nwilcox
Mega Advanced
Mega Advanced
Posts: 269
Joined: Sat Aug 20, 2005 6:14 am
Location: Indianapolis, IN
Contact:

Post by nwilcox »

vikenk wrote:Try setting the menu width from 481px to 100%. That way it will grow and shrink with the table.
removed the height attribute and and the width attribute entirely and the menus still move...

any more suggestions?????? :?:

thank you
vikenk
Mega Advanced
Mega Advanced
Posts: 297
Joined: Tue Nov 29, 2005 7:38 pm

Post by vikenk »

Hi,

OK....I grabbed your code and played with it on my computer. I noticed that the menu coming out of the table was NOT a problem in Firefox, only in IE. I figured that it was a normal IE quirk. Internet explorer treats tables and div's slightly different from other browsers.

Your webpage did not have a DOCTYPE declaration, so I added one and the problem went away! No more busting out of the tables. I added this to the top of the page before the HTML tag.

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
So, it should now look like this

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>

<head>
<title>Hearthview Residential: Welcome to Hearthview Residential, Inc.</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
The DOCTYPE will force IE to follow the standard set of HTML parsing rules. Without the DOCTYPE, IE is free to interpret the HTML code any way it wants.

Add the DOCTYPE to all your pages. You don't have to use the Strict DOCTYPE, you can use the Transitional, if you'd like. To read on the differences between the DOCTYPES, read here http://www.alistapart.com/articles/doctype and here http://css.maxdesign.com.au/listamatic/ ... xmodel.htm

Beware, though! Adding a DOCTYPE may make you have to slightly redesign your pages because of the difference in the TABLE and DIV renderings.

Your website is written very well, so I assume you're an experienced designer and you probably already know all this. If that's the case, then I apologize if it seems like I'm treating you like a beginner! :oops:
User avatar
nwilcox
Mega Advanced
Mega Advanced
Posts: 269
Joined: Sat Aug 20, 2005 6:14 am
Location: Indianapolis, IN
Contact:

Post by nwilcox »

thanks vikenk! I'll give that a shot

I didn't actually "slice and dice the page" originally, I've been doing edits here ant there, adding elements as requested. Unfortuntely it is all table based (not something I would have done myself)
User avatar
nwilcox
Mega Advanced
Mega Advanced
Posts: 269
Joined: Sat Aug 20, 2005 6:14 am
Location: Indianapolis, IN
Contact:

Post by nwilcox »

okay that fixed it but now the home page isn't vertically aligned center...

ack!
vikenk
Mega Advanced
Mega Advanced
Posts: 297
Joined: Tue Nov 29, 2005 7:38 pm

Post by vikenk »

Hmmm...I'm not an expert, but I did a Google search and came up with this:

http://apptools.com/examples/tableheight.php

Maybe you can use it?
User avatar
nwilcox
Mega Advanced
Mega Advanced
Posts: 269
Joined: Sat Aug 20, 2005 6:14 am
Location: Indianapolis, IN
Contact:

Post by nwilcox »

that fixed the vertical spacing but we're back to the original problem yet again... the menu is breaking out of its containing table cell and staying "fixed"

ackkkkkkkkkkkkkkk :cry:
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Looks like you've removed the doctype suggested by vikenk. It's an item that should really be in place. However, at this point I'm not sure I'd go strict. Try...

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
...as the first line of your code.

Also, just for fun, try changing the suffix on your data file to .asp; i.e., menu_data.asp.
User avatar
nwilcox
Mega Advanced
Mega Advanced
Posts: 269
Joined: Sat Aug 20, 2005 6:14 am
Location: Indianapolis, IN
Contact:

Post by nwilcox »

okay doctype is set, the menu code has been moved into the body tag

added the margins as suggestion to get the design to stay at 100%

but .. again, the menu is busting out of the table cell!
User avatar
nwilcox
Mega Advanced
Mega Advanced
Posts: 269
Joined: Sat Aug 20, 2005 6:14 am
Location: Indianapolis, IN
Contact:

Post by nwilcox »

nwilcox wrote:okay doctype is set, the menu code has been moved into the body tag

whoops! okay I've added the margins as suggestion to get the design to stay at 100%

but .. again, the menu is busting out of the table cell!
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

I'm not sure exactly what, "...the menu is busting out of the table cell..." means. FWIW, I'm not seeing anything unusual in IE7 or FF2 (both release versions). I no longer have IE6 loaded. Can you load up a screen shot?

Also, minor point, our instructions do not call for the comment tags you have in the main menu script. May or may not mean anything.
User avatar
nwilcox
Mega Advanced
Mega Advanced
Posts: 269
Joined: Sat Aug 20, 2005 6:14 am
Location: Indianapolis, IN
Contact:

Post by nwilcox »

John wrote:I'm not sure exactly what, "...the menu is busting out of the table cell..." means. FWIW, I'm not seeing anything unusual in IE7 or FF2 (both release versions). I no longer have IE6 loaded. Can you load up a screen shot?

Also, minor point, our instructions do not call for the comment tags you have in the main menu script. May or may not mean anything.
here is a screen shot in IE 6... (it is actually fine in Firefox.. no surprise)

...image removed...

when you resize the browser window to make it bigger or smaller, the menu stays fixed to the position it was when the window first loaded the page. When the browser repositions the contents of the window upon reisze, the Milonic menu doesn't move with it. It "breaks out of the table cell" and just sits all by itself.. in this case way above where it should be...
Last edited by nwilcox on Mon Oct 30, 2006 11:34 pm, edited 2 times in total.
vikenk
Mega Advanced
Mega Advanced
Posts: 297
Joined: Tue Nov 29, 2005 7:38 pm

Post by vikenk »

That's weird, it doesn't do that for me. I use IE6 / Windows XP

See this screenshot, taken at 1024x768 resolution. See how small your window is. The menu is intact. Not sure why it still happens for you, though.

Image
User avatar
nwilcox
Mega Advanced
Mega Advanced
Posts: 269
Joined: Sat Aug 20, 2005 6:14 am
Location: Indianapolis, IN
Contact:

Post by nwilcox »

it doesn't happen when the browser is that small. If you drag the bottom of your browser window down and watch what happens...

drag it to the full size vertically... as soon as you move it down, the menu will stay where it was when the page first loaded.

The weird thing is when the browser is full screen.. then I resize it, the menu stays in place. If the browser is not full screen and I start moving it aroud, it screws up and pops out of the table.
Last edited by nwilcox on Mon Oct 30, 2006 11:21 pm, edited 1 time in total.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

I get the same thing as Vikenk on IE5.5 800x600 and 1024x768 which I then used the arrow to make the window smaller in both cases. The menu stays just fine. Same thing on IE6 on 1024x728

Ruth
User avatar
nwilcox
Mega Advanced
Mega Advanced
Posts: 269
Joined: Sat Aug 20, 2005 6:14 am
Location: Indianapolis, IN
Contact:

Post by nwilcox »

here is another example: The two rows of buttosn here are two separate Milonic menu calls so that is why I'm even more concerned. It is happening to both menus. Windows XP with IE6, all windows hotfixes, etc etc

Image[/img]
Post Reply