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

Ignore data-src when src is real image. #13

Closed
wants to merge 1 commit into from
Closed

Ignore data-src when src is real image. #13

wants to merge 1 commit into from

Conversation

mgdodge
Copy link

@mgdodge mgdodge commented Nov 16, 2012

If both data-src and src are present, and src is set to something other
than holder.js (or other configured domain), leave the image untouched.

Someone using holder.js in a CMS template can then easily set just the src of the image instead of rewriting the entire image tag to override the holder.js fallback. Example:

<?php
// Set image source if available
$src = isset($realimg) ? " src='$realimg'" : ''; ?>
<img data-src="holder.js/500x300"<?php echo $src; ?> />

If both data-src and src are present, and src is set to something other
than holder.js (or other configured domain), leave the image untouched.
@imsky imsky closed this in d45b3ed Nov 16, 2012
@mgdodge
Copy link
Author

mgdodge commented Nov 16, 2012

Much more concise. Can't believe I missed that, actually.

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