uikit / uikit-site

🌎 Website and Documentation
https://getuikit.com
365 stars 331 forks source link

Update lightbox.md #96

Closed xjrcode closed 6 years ago

xjrcode commented 6 years ago

Small error on lightboxPanel constructor documentation.

janschoenherr commented 6 years ago

The constructor documentation is here https://getuikit.com/docs/lightbox#initialization

You pass the existing lightboxPanel element to retrieve the component.

xjrcode commented 6 years ago

Therefore you are doing the test in a bad way. Code copied from your test:

UIkit.lightboxPanel({
                    items: [
                        {source: 'images/size1.jpg', caption: '900x600'},
                        {source: 'images/size2.jpg', caption: '700x500'},
                    ]
                }).show();

The parameter is not an element, is an object with the config.

janschoenherr commented 6 years ago

Yes, but the test is first creating the lightboxPanel and then showing it. The method documentation is usually about calling a method on an existing component.

xjrcode commented 6 years ago

Sorry then, I badly understood the documentation. I thought that lightbox is used for elements and lightboxPanel for javascript use (without element)