[英]Change object value in javascript from another file
I am using this code 我正在使用此代码
$.fn.lightbox.defaults = {
adminBarHeight:28,
overlayOpacity: 0.8,
borderSize: 10,
imageArray: new Array,
activeImage: null,
inprogress: false, //this is an internal state variable. don't touch.
widthCurrent: 250,
heightCurrent: 250,
xScale: 1,
yScale: 1,
displayTitle: true,
disableNavbarLinks: true,
loopImages: true,
imageClickClose: true,
jsonData: null,
jsonDataParser: null,
followScroll: false,
isIE8: false //toyNN:internal value only
};
When I adjust borderSize I get the effect I want however I need to be able to adjust this from another script rather than just changing the value above because I need to leave the code above unchanged as it may be overwritten during updates. 当我调整borderSize时,我得到了想要的效果,但是我需要能够从另一个脚本中调整它,而不仅仅是更改上面的值,因为我需要保持上面的代码不变,因为在更新过程中它可能会被覆盖。 How can I do this
我怎样才能做到这一点
I tried 我试过了
$.fn.lightbox.defaults[borderSize] = 0;
but it had no effect. 但是没有效果。
The code is from WP Lightbox 2. 该代码来自WP Lightbox 2。
它的:
$.fn.lightbox.defaults['borderSize']
$.fn.lightbox.defaults['borderSize'] = 0;
or 要么
$.fn.lightbox.defaults.borderSize = 0;
And ensure that this script is loaded after 并确保此脚本在加载后
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.