Chunks of page disappearing?

  • davenewt
  • Graduate
  • Graduate
  • User avatar
  • Posts: 160

Post 3+ Months Ago

Hi guys,

Strange first question, but this is bugging me no end!

I'm pulling together the structure for a site (it's a company intranet), at the moment just working on the one page to get the page layout sorted.

The page contains several DIVs ('masthead' on top, 'navbar' on left, 'content' on right etc.) and some rollover section links (in the navbar DIV), to which are attached popup js menus (auto-written by Dreamweaver MX 04).

This afternoon, whilst modifying the layout of the page slightly, I did *something* which causes the following problem (viewing in IE, WinXP):

When you roll over one of the section links in the navbar, and a javascripted popup menu appears, half of the page just *vanishes* (all the DIVs normally displayed under the navbar, and half the DIVs in the rest of the page!).

This didn't happen earlier today, and it's got me stumped. :( I haven't changed any of the HTML or JS relating to the menus... not that I'm aware of anyway. I know, I should have been working on a second copy of the page, but I wasn't. I will be from now on, but to get back to the normal state of affairs, I'll be needing some suggestions.

Any ideas what might have gone pear-shaped to make DIVs disappear when a JS popup menu appears?

Thanks,
Dave.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • digitalMedia
  • a.k.a. dM
  • Genius
  • User avatar
  • Posts: 5149
  • Loc: SC-USA

Post 3+ Months Ago

It would probably be easier to troubleshoot if you could post the page.

:) ;)
  • davenewt
  • Graduate
  • Graduate
  • User avatar
  • Posts: 160

Post 3+ Months Ago

:) Ok, what would be the best way of doing that? I can make a .zip, but where/how to upload here? I can't just post a URL 'cos it's an intranet and only on my local machine at the mo.

Anyways, I have been investigating this morning, and it seems it's something to do with one too many <DIV>s... The site is laid out with these DIVs...

Code: [ Select ]
-----------------------masthead---------------------------
---------------------global links-------------------------
:     :                 :     :
:     :                 :     :
: navbar  :    content          : latest :
:     :                 :     :
:     :                 :     :
------------------------footer----------------------------
  1. -----------------------masthead---------------------------
  2. ---------------------global links-------------------------
  3. :     :                 :     :
  4. :     :                 :     :
  5. : navbar  :    content          : latest :
  6. :     :                 :     :
  7. :     :                 :     :
  8. ------------------------footer----------------------------


The js menu popups are attached to text links in the navbar. When the menus appear, the bottom chunk of the navbar, some of the content, and the latest DIVs all disappear :shock:

Experimenting with the code this morning, I have discovered if I take out the latest DIV (right hand column), this problem goes away.

I'll continue investigating and see if I can add another DIV in to get the third column without this weirdness...

In the meantime, if there's a way to post .zips to this board, I may have to do that if I can't suss this myself.

One question: you *can* have DIVs within DIVs, can't you? The navbar DIV is made up of several other DIVs (sectionlinks, searchbox, etc)... is this good practice, or should I only have one DIV per column?

Thanks :beerchug:
Dave.
  • digitalMedia
  • a.k.a. dM
  • Genius
  • User avatar
  • Posts: 5149
  • Loc: SC-USA

Post 3+ Months Ago

yes, you can nest DIV's within each other. No problem. The problems usually occur when you've got paddings and margins cascading through several selector definitions and colliding with each other on the page.

Personally, what I like to do is set up my main containers as DIV's, the use intrinsic HTML tags like H1, H2, H3, P, SPAN etc within the DIV container.

As far as making your page available to us, I think the best bet would be to paste your code straight into the forum. Just make sure you use the CODE tags in your post.

;)
  • davenewt
  • Graduate
  • Graduate
  • User avatar
  • Posts: 160

Post 3+ Months Ago

Well, think I may have found a solution...

I was looking around for other js menu scripts, and found this one...

http://www.softcomplex.com/products/tig ... demo/blue/

...which is freely available, pretty good looking, etc. Anyway, in the HTML examples they provide is this note:

Code: [ Select ]
// Note where menu initialization block is located in HTML document.
// Don't try to position menu locating menu initialization block in
// some table cell or other HTML element. Always put it before </body>
  1. // Note where menu initialization block is located in HTML document.
  2. // Don't try to position menu locating menu initialization block in
  3. // some table cell or other HTML element. Always put it before </body>


So I tried it on the page I was having trouble with, putting the menu code and the loadmenus function...

Code: [ Select ]
<script language="JavaScript" src="mm_menu.js"></script>
<script language="JavaScript1.2">mmLoadMenus();</script>
  1. <script language="JavaScript" src="mm_menu.js"></script>
  2. <script language="JavaScript1.2">mmLoadMenus();</script>


...at the bottom of the page, just before the </body> tag... and whaddaya know... it works properly. :D Chunks of the page no longer vanish when the menus appear. Seems the 'one too many DIVs?' question was a distraction from the real problem...

Just thought I'd answer my own question here in case anyone else is ever wondering... 8)

Laters!
Dave.

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 50 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.