gpt4 book ai didi

javascript - 如何在 beforeShow block 中覆盖 this.href? (jquery/花式框)

转载 作者:行者123 更新时间:2023-11-30 05:56:15 33 4
gpt4 key购买 nike

我试图覆盖 beforeShow block 中的 this.href 但它不起作用。this.href 的旧值被使用,即使它被覆盖。

代码是:

beforeShow: function (opts, fb_obj) {

// this conditional is some other code checking $(window).width() and $(window).height() and
// if the bigger image will fit; it is simplified here!
if (1) {
var source = this.href;
this.href = source.replace('_large','_super_large');
console.log('retina detacted! ' + source + " " + this.href);
// console output is OK, but this.href is not beeing replaced in the output!
}

最佳答案

如果您想覆盖 this.href 的值,请改用 beforeLoad

注意:这适用于 fancybox v2.0.6+

关于javascript - 如何在 beforeShow block 中覆盖 this.href? (jquery/花式框),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11716298/

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