Skip to content

Conversation

@milansimek
Copy link

As discussed in issue #35

@pau1phi11ips
Copy link

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);
	}
}

@milansimek
Copy link
Author

No it doesn't. My pull request is for srcset attributes, not for source tags inside a picture tag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants