简体   繁体   中英

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. How can I do this

I tried

$.fn.lightbox.defaults[borderSize] = 0;

but it had no effect.

The code is from 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM