开发者

Preventing jQuery click() conflicts

I have a table of locations. Each location has a individual url associated with it. I am using one column to activate / deactivate that url so I can turn locations off and on. I'm using jQuery's bind /开发者_如何学Go click to do that with an AJAX request.

I now want to make clicking anywhere on that table row take the user to that individual url.

var url="http://mysite.com/"+jQuery(event.target).siblings("td.url").text();
jQuery(location).attr('href', url);

The problem is that it's intercepting my other columns click. Is there a way to say something like:

if(event.target != jQuery("td.active")){ //redirect }


if(!jQuery(event.target).is('.active')) {

is what you want.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜