Skip to content

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.

2 participants