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

one more placeholder case for blank src attribute #190

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

Conversation

Martin91
Copy link

In some templates, such as ERB for Rails, it will automatically generate a <img> tag likes:

<img class="lazy" data-original="something.jpg" height="180" src="" width="180">

so the plugin will not work because the if in https://github.com/tuupola/jquery_lazyload/blob/master/jquery.lazyload.js#L92

if ($self.attr("src") === undefined || $self.attr("src") === false)  {

will always be false, and the placeholder will not be shown.

I append a new case which considers a blank src attribute like ''.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants