开发者

How to get a link to take priority over toggle effect

开发者 https://www.devze.com 2023-02-22 18:03 出处:网络
I have a jquery animation that toggles the width of a div. Within the div, I have a span that has a link in it. Every time i click the link, instead of being directed to the link url the div\'s with i

I have a jquery animation that toggles the width of a div. Within the div, I have a span that has a link in it. Every time i click the link, instead of being directed to the link url the div's with is toggled instead.

I have a simple demo here: http://jsfiddle.net/ewWFc/

if you expand the orange block and hover over the bottom part, there should be a more link. How do I change my code so the the more link will take me to the corresponding url and take priority over the tog开发者_开发问答gle effect?


Add a click handler that stops the click from bubbling up to the containing div:

$('#slider .more a').click(function(e){
  e.stopPropagation();
});
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号