Hacker News new | past | comments | ask | show | jobs | submit login

I'm on my phone so all I can see is a jquery mobile-based site but, given some of the comments, I assume he's probably overloaded the scroll event. That event fires _a lot_ so if you load it up with too much logic or attach too many listeners, you get some nasty lag (think "New Twitter"). You're better off attaching a single listener that does some light action like setting a variable (`didScroll = true`) and an interval timer (every 50ms is fine) that checks that variable and performs some logic as a result.

John Resig wrote up an article about this very probably several years back. If curious, I can dig it up.




John Resig article circa jQuery 1.4.4 but still relevant: http://ejohn.org/blog/learning-from-twitter/




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: