Reputation: 341
This is doing nothing:
$("#nav li ul li").click(function(){
$(this).find('ul:first').css({
visibility: "visible"
});
});
This is working (showing and hiding):
$("#nav li ul li").toggle(function() {
$(this).find('ul:first').css({
visibility: "visible"
});
}, function() {
$(this).find('ul').css({
visibility: "hidden"
});
});
I want to get the first one to work, I don't want it to toggle.
Upvotes: 1
Views: 125
Reputation: 8457
CSS
.ghost{visibility:hidden;}
jQuery
$("#nav li ul li").click(function() {
$(this).find('ul:first').toggleClass('ghost')
});
Upvotes: 0
Reputation: 15593
Try this code:
$("#nav li ul li").click(function(){
$(this).find('ul').first().css("visibility","visible");
});
Upvotes: 1