how change options from lightbox?

主宰稳场 提交于 2020-01-17 01:16:43

问题


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:


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.



来源:https://stackoverflow.com/questions/14056072/how-change-options-from-lightbox

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!