You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/*! Picturefill - Responsive Images that work today. (and mimic the proposed Picture element with span elements). Author: Scott Jehl, Filament Group, 2012 | License: MIT/GPLv2 */
2
+
3
+
(function(w){
4
+
5
+
// Enable strict mode
6
+
"use strict";
7
+
8
+
w.picturefill=function(){
9
+
varps=w.document.getElementsByTagName("span");
10
+
11
+
// Loop the pictures
12
+
for(vari=0,il=ps.length;i<il;i++){
13
+
if(ps[i].getAttribute("data-picture")!==null){
14
+
15
+
varsources=ps[i].getElementsByTagName("span"),
16
+
matches=[];
17
+
18
+
// See if which sources match
19
+
for(varj=0,jl=sources.length;j<jl;j++){
20
+
varmedia=sources[j].getAttribute("data-media");
21
+
// if there's no media specified, OR w.matchMedia is supported
This plugin tells WordPress to create three additional sizes for images you upload. Then it outputs special HTML (via a shortcode) that works with the Picturefill library to achieve responsive images in content.
0 commit comments