Open milansimek opened 6 years ago
This makes more sense if added this way
var source = this.getAttribute(attrib);
source = source || this.getAttribute("data-src");
if (source) {
if (this.tagName === 'IMG') {
this.setAttribute("src", source);
} else if (this.tagName === 'SOURCE') { // add srcset support
this.setAttribute("srcset", source);
} else {
this.style.backgroundImage = 'url(' + source + ')';
}
if (typeof callback === "function") {
callback.call(this);
}
}
No it doesn't. My pull request is for srcset attributes, not for source tags inside a picture tag.
As discussed in issue #35