我试图this.href
在beforeShow
块中覆盖,但它不起作用。的旧值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!
}