hubrid
hubrid

Reputation: 155

problem with jquery overriding link href

I have a div (.questionsList) that contains a link. When the div is clicked, I have an element #slider that slides out. However, when the link inside the div is clicked, I want to follow that link. The problem is, when I click the link, the jquery slide effect is overriding the link href so the slider slides out and the link does nothing. How can I fix this?

This is the code I was using prior to recognizing the problem.

$(".questionsList").toggle(function() {       
    $('#slider').animate({ left: '375' }, 500);
}, function() {
    $('#slider').animate({ left: '0'}, 500);
});

Upvotes: 0

Views: 238

Answers (1)

David Tang
David Tang

Reputation: 93674

The behaviour has nothing to do with the piece of code you have shown.

I suspect you have either:

return false;

Or:

event.preventDefault();

Remove any of these from the click handler for your div and your link should work.

Upvotes: 2

Related Questions