jQuery disable a link

Posted by davebowker on Stack Overflow See other posts from Stack Overflow or by davebowker
Published on 2009-06-09T14:27:59Z Indexed on 2010/04/18 23:53 UTC
Read the original article Hit count: 346

Filed under:
|
|

Hey,

Anyone know how to disable a link in jquery WITHOUT using return false;?

Specifically, what I'm trying to do is disable the link of an item, performing a click on it using jquery which triggers some stuff, then re-enabling that link so that if it's clicked again it works as default.

Thanks. Dave

UPDATE Here's the code. What it needs to do after the .expanded class has been applied is to re-enable the disabled link.

$('ul li').click(function(e) {
    e.preventDefault();
    $('ul').addClass('expanded');
    $('ul.expanded').fadeIn(300);
    //return false;
});`

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about disable