Open strarsis opened 6 years ago
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, image@2x.png 2x" width="800" height="600">
`)
instance.show()
I agree that an official demo would be nice! PR welcome.
@electerious: And can this lightbox also re-use the srcset from an existing linked <img>
?
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()
@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 :)
A demo for srcset support would be great!