- Local time
- Oct 24, 2019
Trying to create a script that checks the content of an existing tag, eg:
<div class="whatever" data-src="https://cdn.mydomain.com/CRLS0004/CRLS0004.png">
and uses the CRLS0004 part as part of an injected style for the page's background image, eg:
background-image: url(https://cdn.mydomain.com/CRLS0004/CRLS0004.png?scale.width=660&scale.height=1239 660w);
I'll be wrapping it in multiple media queries so I can control the size of the image being served.
Thanks in advance