¡@

Home 

2014/10/16 ¤W¤È 12:07:57

jquery Programming Glossary: scrolltimer

More efficient way to handle $(window).scroll functions in jquery?

http://stackoverflow.com/questions/7392058/more-efficient-way-to-handle-window-scroll-functions-in-jquery

since that's where the issue of scroll lag would be most pronounced. Here's the general idea for how to do that var scrollTimer null window .scroll function if scrollTimer clearTimeout scrollTimer clear any previous pending timer scrollTimer setTimeout.. would be most pronounced. Here's the general idea for how to do that var scrollTimer null window .scroll function if scrollTimer clearTimeout scrollTimer clear any previous pending timer scrollTimer setTimeout handleScroll 500 set new timer function.. Here's the general idea for how to do that var scrollTimer null window .scroll function if scrollTimer clearTimeout scrollTimer clear any previous pending timer scrollTimer setTimeout handleScroll 500 set new timer function handleScroll scrollTimer..