开发者

jQuery UI tabs and jQuery functions on a page

开发者 https://www.devze.com 2023-01-29 13:30 出处:网络
When page containing jquery-ui-tabs at the top loads for the first time, jquery elements bellow the tabs do work (e.g. for deleting or editing开发者_运维知识库table rows on the page).. but when anothe

When page containing jquery-ui-tabs at the top loads for the first time, jquery elements bellow the tabs do work (e.g. for deleting or editing开发者_运维知识库 table rows on the page).. but when another tab gets clicked and the previous tab gets clicked again, the jquery functions on the page (the ones for deleting or editing) don't work anymore.

?


look at using jquery live for your events. http://api.jquery.com/live/

$('#deleteButton').live('click', function(){
    //do delete
});

$('#editButton').live('click', function(){
    //do edit
});

this ensures the events stay registered for all current and future instances.

0

精彩评论

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