javascript - How to use Picturefill -


i'm trying use picturefill website neither version seems work.

in head of page:

<script src="js/picturefill.js"></script> 

i have 2 images, welcome.jpg larger image , welcome_sm.jpg smaller:

<span data-picture data-alt="welcome novus landscapes"> <span data-src="images/welcome_sm.jpg"></span> <span data-src="images/welcome.jpg" data-media="(min-width: 58em)"></span> <noscript> <img src="images/welcome_sm.jpg" alt="welcome novus landscapes"> </noscript> </span> 

do need else work? don't see since javascript enabled on browsers of course eliminates fallback due noscript tag.

what doing wrong?

my website novuslandscapes dot com

thanks,

john

there's few things need do.

  1. read or watch here

  2. place script @ bottom of html, before </body>

try syntax, copied here

<article> <img      src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/small.png"      srcset="https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/large.png 1280w,              https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/medium.png 640w,              https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/small.png 320w"      sizes="(min-width: 500px) 50%, 100%"        alt="a woman reading"> </article> 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -