3 回答

TA貢獻1895條經(jīng)驗 獲得超7個贊
live
delegate
live
bind
:
$('a.myClass').live('click', function() { ... });
delegate
$('#containerElement').delegate('a.myClass', 'click', function() { ... });
live
document
delegate
#containerElement
live
live
a.myClass
delegate
#containerElement
live
a.myClass
它現(xiàn)在是否存在. delegate
delegate
live
live
delegate
live
delegate
on
$('#containerElement').on('click', 'a.myClass', function() { ... });

TA貢獻1830條經(jīng)驗 獲得超3個贊
你會用 delegate
在 body
元素,所以您只需使用 live
而是因為它更簡單。 您需要使用jQuery庫的舊版本,其中 delegate
事件尚未實現(xiàn)。
添加回答
舉報