Skip to content

Commit e130558

Browse files
committed
(docs) Update usage instruction with 'load' event note
Resolves #214
1 parent a5118d2 commit e130558

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,16 @@ where the first argument is a selector to a gallery (or galleries) containing `a
139139

140140
To use captions put a `title` or `data-caption` attribute on the `a` tag.
141141

142+
Note: if you import baguetteBox using the `<script>` tag, remember to run it after the document has loaded:
143+
144+
```html
145+
<script>
146+
window.addEventListener('load', function() {
147+
baguetteBox.run('.gallery');
148+
});
149+
</script>
150+
```
151+
142152
## Customization
143153

144154
You can pass an object with custom options as the second parameter.

0 commit comments

Comments
 (0)