Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demo for srcset support #10

Open
strarsis opened this issue Nov 13, 2017 · 4 comments
Open

Demo for srcset support #10

strarsis opened this issue Nov 13, 2017 · 4 comments

Comments

@strarsis
Copy link

A demo for srcset support would be great!

@electerious
Copy link
Owner

You can use srcset like usual. Here's a quick demo:

import * as basicLightbox from 'basiclightbox'

const instance = basicLightbox.create(`
    <img src="assets/images/image.png" srcset="image.png 1x, [email protected] 2x" width="800" height="600">
`)

instance.show()

I agree that an official demo would be nice! PR welcome.

@strarsis
Copy link
Author

@electerious: And can this lightbox also re-use the srcset from an existing linked <img>?

@electerious
Copy link
Owner

electerious commented Nov 24, 2017

Yes, basicLightbox can show whatever you pass to it. Here's a quick example (untested):

import * as basicLightbox from 'basiclightbox'

const img = document.querySelector('#img')
const html = img.outerHTML
const instance = basicLightbox.create(html)

instance.show()

@strarsis
Copy link
Author

strarsis commented Nov 24, 2017

@electerious: A WordPress plugin would be great!
I cannot find a plugin that offers srcset support (which WordPress already provides for the <img>s).
This would be unique :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants