Servage Magazine

Information about YOUR hosting company – where we give you a clear picture of what we think and do!

Archive for February, 2013

jQuery Timeout Management

Friday, February 1st, 2013 by Servage
When you develop something with Javascript an jQuery, you may wish to use timeouts to gain a finer control over events and how they are triggered. Let's take scrolling as an example. When a user finishes to scroll, you wish to trigger and event. Unfortunately there is no "finish scroll event" in jQuery - since this is hard to determine and up to individual use-cases when exactly you wish the scroll to be registered as ended (the timeout). Example You register that the user starts to scroll - so you can fire an event called scrollStop, which is fired as long as the browser detects the user is scrolling. At some point, ...