Win a copy of Java Persistence with Spring Data and Hibernate this week in the Spring 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
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

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: 67699
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.
 
Get me the mayor's office! I need to tell her about this tiny ad:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic