2013-04-30 79 views
0

我有一个jquery ui可选功能的小问题。jquery ui selectable导致超链接问题

$("#test").selectable({ 
    filter:'label', 
    stop: function() {   
     $(".ui-selected input", this).each(function() { 
      this.checked= !this.checked 
     }); 
    } 
}); 

http://jsfiddle.net/APfcf/

DIV标签 “测试” 中的HTML链接被点击时不响应。虽然DIV标签之外的HTML链接行为正常。

我试图让那些在DIV标签内的链接再次工作。他们似乎回应,如果你右键单击并在新标签页或窗口打开,但左点击不会做任何事情。

任何帮助表示赞赏。

感谢

回答

0

使用取消,以确保选择并不适用于你的锚标签:

$("#test").selectable({ 
    filter:'label', 
    cancel: 'a', 
    stop: function() {   
     $(".ui-selected input", this).each(function() { 
      this.checked= !this.checked 
     }); 
    } 
}); 
+0

大,是解决它。谢谢! – Konrad 2013-04-30 23:25:37

+0

没问题,你能标记我的答案是正确的吗? = d – 2013-05-01 00:10:27