Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added srcset support #147

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

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