basicLightbox icon indicating copy to clipboard operation
basicLightbox copied to clipboard

Demo for srcset support

Open strarsis opened this issue 8 years ago • 4 comments

A demo for srcset support would be great!

strarsis avatar Nov 13 '17 22:11 strarsis

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.

electerious avatar Nov 24 '17 10:11 electerious

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

strarsis avatar Nov 24 '17 14:11 strarsis

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 avatar Nov 24 '17 21:11 electerious

@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 :)

strarsis avatar Nov 24 '17 22:11 strarsis