Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

How to overlap two or more <div>s?

 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
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

Thanks
Ashish
 
Sheriff
Posts: 67592
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic