nanorep.sdk.AutoModal

This component allows to activate automatic lightbox.

In case of using this SDk on page with widget at the same time - should be specified as accurately as possible

Basic usage

1. Add script to your page:

<script src="https://<AccountName>.nanorep.co/web/include.js?sdk=auto-modal"></script>

2. Initialize automatic modal component:

new nanorep.sdk.AutoModal({
  imageSelector: '.images'
});
<img src="//via.placeholder.com/800x600" width="500" class="images" alt="test image">

Options

imageSelector

Type: String

Default: '.answer-body img[src]'

Specify CSS selector to match <img> that should use lightbox

new nanorep.sdk.AutoModal({
  imageSelector: 'img[alt="test image"]'
});
<img src="//via.placeholder.com/800x600" width="500" alt="another image">
<img src="//via.placeholder.com/800x600" width="500" alt="test image">