[問題] 更新Jquery版本後click event失效
先自招一下 小弟是前端人員 對於Jquery研究並沒有很深
僅限於怎麼讓效果出來 通常是參考Jquery Demo
原始碼優化的能力幾乎是0 XD
如果有很白痴的問題請多指教
目前遇到一個問題 原本有一個TABLE
要讓它在hover及click的時候加上一個css class讓背景顏色不同
在將Jquery版本更新到1.6.2後 click event就失效了 但hover event還是正常
正確的說 是更新到1.6之後的版本就會遇到此問題
試過1.4 1.5均正常 CDN來源為Google Libraries
原始碼如下
$(function(){
$(".table_show table tr").click(function() {
$(this).addClass("tr_click");
}, function() {
$(this).removeClass("tr_click");
});
$(".table_show table tr").hover(function() {
$(this).addClass("tr_hover");
}, function() {
$(this).removeClass("tr_hover");
});
})
html結構大概為
<div class="table_show">
<table> <tr> ..... </tr> <tr> ..... </tr> </table>
</div>
想請問 造成hover正常 click卻無效的可能問題有哪些
是我寫的code有問題嗎 XD
或者是其它原因?
再麻煩知道問題點的版友幫忙解答一下 謝謝!!
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 122.116.14.188
※ 編輯: kurtisgod 來自: 122.116.14.188 (10/11 16:43)
※ 編輯: kurtisgod 來自: 122.116.14.188 (10/11 16:43)
※ 編輯: kurtisgod 來自: 122.116.14.188 (10/11 16:45)
→
10/11 20:12, , 1F
10/11 20:12, 1F
→
10/11 20:13, , 2F
10/11 20:13, 2F
推
10/12 21:00, , 3F
10/12 21:00, 3F
推
10/12 21:04, , 4F
10/12 21:04, 4F
推
10/13 23:21, , 5F
10/13 23:21, 5F
→
10/23 19:48, , 6F
10/23 19:48, 6F
Ajax 近期熱門文章
PTT數位生活區 即時熱門文章
13
23