2013-04-30 77 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