gpt4 book ai didi

jQuery 工具叠加和 jQuery.live 事件

转载 作者:行者123 更新时间:2023-12-03 22:55:49 24 4
gpt4 key购买 nike

如何使用 jQuery.live 实现此功能?

$("a[rel]").overlay({
mask: '#3B5872',
effect: 'apple',
api: true,
onBeforeLoad: function () {
var wrap = this.getOverlay().find(".contentWrap");
wrap.load(this.getTrigger().attr("href"));
}
});

我尝试过但没有成功:

$("a[rel]").live('click', function () {
alert('live');
$(this).overlay({
mask: '#3B5872',
effect: 'apple',
api: true,
onBeforeLoad: function () {
var wrap = this.getOverlay().find(".contentWrap");
wrap.load(this.getTrigger().attr("href"));
}
});
});

最佳答案

您需要将其设置为加载配置。您可以通过将 load: true 添加到配置对象来做到这一点。

$("a[rel]").live('click', function (e) {
e.preventDefault(); //prevent default link action

$(this).overlay({
mask: '#3B5872',
effect: 'apple',
api: true,
onBeforeLoad: function () {
var wrap = this.getOverlay().find(".contentWrap");
wrap.load(this.getTrigger().attr("href"));
},
load: true
});
});

这里是the docs .

关于jQuery 工具叠加和 jQuery.live 事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3326168/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com