Codeinwp / Ideal-Image-Slider-JS

Quite simply the ideal Image Slider in vanilla JS.
http://idealimageslider.com
GNU General Public License v3.0
1.57k stars 160 forks source link

srcset support #67

Open tyssen opened 9 years ago

tyssen commented 9 years ago

Hi, would it be possible to have srcset support added for Ideal Image Slider?

Currently I'm setting the src as the smallest image and then using Picturefill to replace that with larger sizes set in the srcset attribute, but the slider script only uses the value set in the src which means the images get stretched on larger screens.

wknowles commented 8 years ago

if you check out the docs - particularly the "Getting Started" bit you can see that srcset can be specified by data-src-2x=. It works a dream!

tyssen commented 8 years ago

That only covers 2x images though. Support seems lacking for markup like:

<img src="small.jpg"
 srcset="large.jpg 1024w,
         medium.jpg 640w,
         small.jpg 320w"
 sizes="(min-width: 36em) 33.3vw, 100vw">
wknowles commented 8 years ago

🤔 humm I hadn't thought about that! It should be possible - I would like this feature too. My JS is not good but I will have a look at it.

rickibarnes commented 8 years ago

+1 for this as a feature, would be great.