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

在安卓设备下,el.setAttribute('src', src) 这么设置src会导致layout,layout后scroll事件会被循环调用 #72

Closed
zyip opened this issue Nov 30, 2016 · 1 comment

Comments

@zyip
Copy link

zyip commented Nov 30, 2016

const setElRender = (el, bindType, src, state, context) => {
    if (!bindType) {
        //el.setAttribute('src', src) 
        if(el.getAttribute('src')!=src){
            el.setAttribute('src', src)
        }
    } else {
        el.style[bindType] = 'url(' + src + ')'
    }
    el.setAttribute('lazy', state)
    if (context) {
        $Lazyload.$emit(state, context)
    }
}
@hilongjw
Copy link
Owner

hilongjw commented Dec 12, 2016

@zyip fix in commit

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

No branches or pull requests

2 participants