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

imglazyload在页面动态渲染时图片不加载的问题 #213

Open
fancyoung opened this issue Jul 25, 2014 · 0 comments
Open

imglazyload在页面动态渲染时图片不加载的问题 #213

fancyoung opened this issue Jul 25, 2014 · 0 comments

Comments

@fancyoung
Copy link

使用前端MVC框架,页面出来后初始化imglazyload,但页面跳转,再返回时重新初始化imglazyload,发现图片无法加载。
跟踪调试后发现这段:

if ($.isFunction($.fn.imglazyload.detect)) {    //若是增加图片,则处理placeHolder
  _addPlsHolder();
  return this;
};

会导致页面第二次加载时,后面的逻辑中断。

解决方案:在每次重新渲染页面时先设置$.fn.imglazyload.detect = null;

感觉这个问题对于新手不友好,期待能在源码中解决。

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

No branches or pull requests

1 participant