Skip to content

Commit

Permalink
docs upd
Browse files Browse the repository at this point in the history
  • Loading branch information
dimsemenov committed May 24, 2024
1 parent a0298e3 commit 44b065a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Unbinds all events, and closes PhotoSwipe if it is currently open. Once the inst

```js pswpcode
import PhotoSwipeLightbox from '/photoswipe/photoswipe-lightbox.esm.js';
const lightbox = new PhotoSwipeLightbox({
let lightbox = new PhotoSwipeLightbox({
gallery: '#gallery--test-destroy',
children: 'a',
pswpModule: () => import('/photoswipe/photoswipe.esm.js'),
Expand Down Expand Up @@ -67,7 +67,7 @@ Open PhotoSwipe at a given index. Arguments:
If you use `gallery` & `children` options and you omit the second argument (do not provide data source) - PhotoSwipe will use the first `gallery` element. To select another `gallery` element you must define data source as `{ gallery: HTMLElement }`, for example:


<PswpCodePreview galleryID="with-button">
<PswpCodePreview galleryID="with-button">

```js pswpcode
import PhotoSwipeLightbox from '/photoswipe/photoswipe-lightbox.esm.js';
Expand All @@ -86,7 +86,7 @@ document.querySelector('#gallery--with-button').after(btn);
btn.onclick = () => {
// highlight-start
lightbox.loadAndOpen(1, {
gallery: document.querySelector('#gallery--test-destroy')
gallery: document.querySelector('#gallery--with-button')
});

// You also can just trigger the native click
Expand Down

0 comments on commit 44b065a

Please sign in to comment.