Created
October 27, 2015 14:50
-
-
Save SteveDesmond-ca/215a93a4c295d28731bb to your computer and use it in GitHub Desktop.
server-side responsive images (client-side)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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