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

CSS Variables Problem #4

Open
baixiaoji opened this issue Jan 11, 2017 · 3 comments
Open

CSS Variables Problem #4

baixiaoji opened this issue Jan 11, 2017 · 3 comments

Comments

@baixiaoji
Copy link

问题

function setHanld(){
      const suffix = this.dataset.sizing || '';
      // console.log(suffix);
     ....
    }
    inputs.forEach(input => input.addEventListener("mousemove",setHanld)); 

当鼠标只要经过input就会执行setHanld,性能上会不会有点问题

@soyaine
Copy link
Owner

soyaine commented Jan 11, 2017

这是为了在拖动滑块时,能实时显示效果。否则需要等到松开鼠标后才能触发改变。

@baixiaoji
Copy link
Author

是的,我的意思「鼠标不要拖着滑动,在input上的区域滑动就会触发这个效果,是否对性能有影响」

@JQ1008
Copy link

JQ1008 commented Jan 7, 2021

@soyaine
inputs.forEach( input => input.addEventListener('change', handleUpdate));
inputs.forEach( input => input.addEventListener('mousemove', handleUpdate));
添加change和mousemove的这两个事件监听,是否可以直接用一个input的事件代替
inputs.forEach( input => input.addEventListener('input', handleUpdate));

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

3 participants