Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
server-side responsive images (client-side)
var x = screen.width * window.devicePixelRatio;
var y = screen.height * window.devicePixelRatio;
var url = '/image?id=' + id + '&x=' + x + '&y=' + y;
$('.lightbox').css('background-image', 'url("' + url + '")');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.