ryanve / response.js

Responsive design toolkit
http://responsejs.com
Other
801 stars 123 forks source link

Background Images #57

Open jsanglier opened 9 years ago

jsanglier commented 9 years ago

Hi

Just for interest, is there anyway of using this for background images?

Joss

ryanve commented 9 years ago

It's not really designed for use with background images. You can use normal CSS media queries to set different background images at different breakpoints as needed.

jsanglier commented 9 years ago

Thanks Ryan. It was just in a particular scenario where the client can chose the background for a div in the CMS, but I want to use different sizes of that image for different devices. That means that in its simplest form, the background image is loaded using inline styles.

I can solve it by using JQuery to select the correct image depending on device width, but it struck me that your script is halfway to doing that already.

Joss