how change options from lightbox?

2019-09-08 03:17发布

I'm using lightbox2. i went through the example and it works fine. furthermore, a gallery! But when I change some options for lightbox2, for example, labelImage , the option more easy is change code from ligthbox2.js.

I try change options as follow:

$.LightboxOptions.labelImage="My image";

But this does not work.

What should be the right way to set the option?

1条回答
啃猪蹄的小仙女
2楼-- · 2019-09-08 04:14

The lightbox instance is not accessible from the global scope and it automatically initiates after all DOM elements completes loading.

$(function() {
  var lightbox, options;
  options = new LightboxOptions;
  return lightbox = new Lightbox(options);
});

You can't modify the options without modifying the lightbox2 script.

查看更多
登录 后发表回答