ajax怎么清理,jquery cluetip - 清理ajax加载的内容

我正在使用jquery cluetip插件,并试图找出如何删除任何打开cluetip对话框,一旦我通过ajax加载新的内容。我要么停留在仍然显示在新内容之上的对话框,要么我试图修复这些问题的方式实际上会删除所有将来显示的提示对话框。jquery cluetip - 清理ajax加载的内容

这是我的代码,谢谢你的帮助。

在dom准备就绪后,我将cluetip实例化如下。

//activate cluetip

$('a.jTip').cluetip({

attribute: 'href',

cluetipClass: 'jtip',

arrows: true,

activation: 'click',

ajaxCache: false,

dropShadow: true,

sticky: true,

mouseOutClose: false,

closePosition: 'title'

});

当我加载新内容时,我有以下代码。我遇到的问题是$('。cluetip-jtip')。empty()阻止打开对话框在任何加载的新内容上,而destroy函数不会删除任何打开的对话框,而只是破坏当前对象。

$('.next a').live("click", function(){

var toLoad = $(this).attr('href');

var $data = $('#main_body #content');

$.validationEngine.closePrompt('body'); //close any validation messages

$data.fadeOut('fast', function(){

$data.load(toLoad, function(){

$data.animate({

opacity: 'show'

}, 'fast');

//reinitialise datepicker and toolip

$(".date").date_input();

//JT_init();

$('.hidden').hide();

//scroll to top of form

$("html,body").animate({

"scrollTop": $('#content').offset().top + "px"

});

//remove existing instance

//$('a.jTip').cluetip('destroy');

//remove any opened popups

$('.cluetip-jtip').empty();

//reinitialise cluetip

$('a.jTip').cluetip({

attribute: 'href',

cluetipClass: 'jtip',

arrows: true,

activation: 'click',

ajaxCache: false,

dropShadow: true,

sticky: true,

mouseOutClose: false,

closePosition: 'title'

});

});

});

return false;

});

2010-04-23

ted776

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值