开发者

How to get a link to take priority over toggle effect

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜