fallenhero
12 Oct 2010, 02:23 PM
I have built a mega menu, where when you click on the nav link it opens, and when you click again it closes (that works correctly). There is also a close link inside that should toggle it closed when clicked, However in IE, it just reopens it everytime it is clicked. It works correctly in Firefox, Chrome and Safari.
The menu has to open and close with clicks because some of the computers use touch screens. Any ideas?
Here is the stripped down code (showing only one nav link):
JQuery:
$(document).ready(function(){
$('div.megamenu> div').hide();
/* This toggles the nav link open and closed --works correctly */
$(".Benefits-Down").click(function() {
$(".Benefits-Dropped").slideToggle("Fast");
});
/*This is suppose to also toggle it closed, but it doesn't work in IE*/
$(".Benefits-Close").click(function() {
$(".Benefits-Dropped").slideToggle("Fast");
});
});
HTML:
<div class="megamenu">
<ul>
<li class="Benefits-Down"><a href="#">Benefits/Pay</a></li>
<div class="Benefits-Dropped">
Links
<div class="Benefits-Close">
<a href="#">Close</a>
</div>
</div>
</ul>
</div>
The menu has to open and close with clicks because some of the computers use touch screens. Any ideas?
Here is the stripped down code (showing only one nav link):
JQuery:
$(document).ready(function(){
$('div.megamenu> div').hide();
/* This toggles the nav link open and closed --works correctly */
$(".Benefits-Down").click(function() {
$(".Benefits-Dropped").slideToggle("Fast");
});
/*This is suppose to also toggle it closed, but it doesn't work in IE*/
$(".Benefits-Close").click(function() {
$(".Benefits-Dropped").slideToggle("Fast");
});
});
HTML:
<div class="megamenu">
<ul>
<li class="Benefits-Down"><a href="#">Benefits/Pay</a></li>
<div class="Benefits-Dropped">
Links
<div class="Benefits-Close">
<a href="#">Close</a>
</div>
</div>
</ul>
</div>