jquery .click overriding anchor href when i dont want it to!

前端 未结 4 989
孤城傲影
孤城傲影 2021-01-26 11:13

I have a set of nested DIVs that slidetoggle using jQuery as the user clicks on them. Inside the innermost DIV there is an anchor tag with an HREF that should navigate somewhere

4条回答
  •  清歌不尽
    2021-01-26 11:41

    I just came across this issue today. I found a very interesting article that might help. It describes the mis(use) of 'return false' and Jquery events (http://fuelyourcoding.com/jquery-events-stop-misusing-return-false/). I haven't tested the following code on your example, but I think this should work.

    $('.subSystemHeader a').click(function(e){
        e.stopPropagation(); 
    });
    

提交回复
热议问题