I know this is a pretty basic question, but I don’t know how to articulate what I want into a Google search to solve my problem.
I am working on a website for a Non-profit, and I am currently using Jquery and CSS to create a dynamic dropdown navigation bar. The code + examples can be found here: http://designreviver.com/tutorials/jquery-css-example-dropdown-menu/
The Nav menu works great, however when the elements expand, the new content forces the rest of the content on the page to move down and it messes up the entire formatting of the site. Most websites usually just have the Nav bar elements expand OVER the rest of the page without modifying locations…
here is the example code of what I am using:
<ul id="cssdropdown">
<li class="headlink">
<a href="mine.html?search_engines">Search Engines</a>
<ul>
<li><a href="http://google.com/">Google</a></li>
<li><a href="http://yahoo.com/">Yahoo</a></li>
<li><a href="http://live.com/">Live Search</a></li>
</ul>
</li>
<li class="headlink">
<a href="mine.html?shopping">Shopping</a>
<ul>
<li><a href="http://amazon.com/">Amazon</a></li>
<li><a href="http://ebay.com/">eBay</a></li>
<li><a href="http://craigslist.com/">CraigsList</a></li>
</ul>
</li>
</ul>
Then for the CSS:
li.headlink ul { display: none; }
li.headlink:hover ul { display: block; }
Does anyone have any insight about what I might be doing wrong?
Thank you!
Dave
If your markup permits, e.g., your menu is at the top of your page, absolutely position the menu.
View the example on jsFiddle