Evolutio
Evolutio

Reputation: 974

jQuery menu doesn't slide

Why my Accordionmenu won't work?

The menu doesn't slide down.

jQuery:

$('.rights li').click(function(){
$('ol.content').slideDown(500); 
    $(this).next().slideUp('normal');
});

$('ol.content').hide();

jsFiddle: http://jsfiddle.net/QEn6x/

Upvotes: 0

Views: 171

Answers (2)

Christian
Christian

Reputation: 504

The problem was the URL of de a tag.

Add e.preventDefault() and solved the problem.

$('.rights li').click(function(e) {
    e.preventDefault();
    $('ol.content').slideDown(500); 
    $(this).next().slideUp('normal');
});
$('ol.content').hide();

Upvotes: 0

Anujith
Anujith

Reputation: 9370

See this: Sample

$('.rights li').click(function(e) {
    $(this).find('ol.content').slideDown(500);  
    $(this).siblings().find('ol.content').slideUp('normal');
    e.preventDefault();
});

$('ol.content').hide();

Upvotes: 1

Related Questions