Hello,
I had a ticket out to add a drop down menu to my website. The code I received worked. The problem now when I go to add items to another link, it does not work on that link. I am looking for a simple way to have drop down's on my menu. Below is what I have in place now which works but only for 1 link.
Website(
http://evangelosdesigns.com/#!/)
HTML:
<nav class="menu">
<ul id="menu">
<li><a href="#!/page_Evangelos">E
vangelos</
a></li>
<li><a href="#!/page_Services">Fe
atures</a>
</li>
<li><a href="#!/page_Gallery">Gal
lery</a>
<div>
<a href="#!/page_Subvices">Su
b tur
es</a><br />
<a href="#!/page_Subvik">Sub&
nbsp;vings
</a><br />
<a href="#!/page_Subart">Sub&
nbsp;antin
e Art
</a>
</div>
</li>
<li><a href="#!/page_Carvings">By
zantine Art</a></li>
<li><a href="#!/page_Carvings">Sc
ulptures</
a></li>
<li><a href="#!/page_Carvings">Ca
rvings</a>
</li>
<li><a href="#!/page_Contacts">Co
ntacts</a>
</li>
</ul>
</nav>
CSS:
.menu { float:right; padding-top:36px;}
#menu > li { float:left; margin-left:30px; position:relative;}
#menu > li div{
display: none;
text-align: center;
position: absolute;
top:22px;
left: -20px;
background: #ccc;
padding: 3px;
border-radius: 8px
}
#menu > li > a{/* display:block;*/ font:17px 'Asap', sans-serif; color:#fff; text-shadow:1px 1px rgba(0,0,0,.5);}
#menu > li > a:hover, #menu > .active > a{background: blue; }
JAVA:
<script>
var lis = document.getElementById("m
enu").getE
lementsByT
agName("li
");
lis[2].children[0].onclick
= function (event) { // the index 2 is the Gallery
event.preventDefault();
var div1 = this.parentElement.getElem
entsByTagN
ame("div")
[0];
if (div1.style.display == "inline-block") div1.style.display = "none";
else div1.style.display = "inline-block";
}
</script>