Win a copy of Spark in Action this week in the Open Source Projects forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

How to overlap two or more <div>s?

Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to build a multi level navigation bar with help of some javascript and jQuery. But am stuck with some display issue. Specifically the issue is that there are 2 menu bars place horizontally one above other, each enclosed in a <div> element. Initially 2 menubar will remain invisible. On clicking an item, say item1, in the top menu, associated menu bar below should get 'visible' while other menu bars will remain invisible or overlapped. Clicking on second item, say item2, should make the corresponding menu bar visible, overlapping the other one.

Issue I am facing that these 2 menu bars (in 2nd row) are placed stacked vertically instead of overlapping. if I use "style:display=none" then in my javascript I get some error when I try obj.getElementByID(<id>) and nothing seems to function in the javascript.

Here is the Javascript code:

Here is the code segment for top menu bar

PS: Read "href - " as "href =" above

Posts: 67414
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ashish Gupta wrote:PS: Read "href - " as "href =" above

Please post real code. Check "disable HTML" when posting.

And avoid red.
Ashish Gupta
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is the snippet of 'real' code. Not sure whether whole script is expected which might be handful.

Some suggestion will be helpful.
Tomorrow is the first day of the new metric calendar. Comfort me tiny ad:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic