background preloader

JavaScript Misc

Facebook Twitter

Fantastic Micro-Frameworks and Micro-Libraries for Fun and Profit! I need ... a base framework. a DOM utility.

Fantastic Micro-Frameworks and Micro-Libraries for Fun and Profit!

Trigger events when the window is scrolled to certain positions. How JavaScript Timers Work. At a fundamental level it’s important to understand how JavaScript timers work.

How JavaScript Timers Work

Often times they behave unintuitively because of the single thread which they are in. Let’s start by examining the three functions to which we have access that can construct and manipulate timers. var id = setTimeout(fn, delay); – Initiates a single timer which will call the specified function after the delay. The function returns a unique ID with which the timer can be canceled at a later time.var id = setInterval(fn, delay); – Similar to setTimeout but continually calls the function (with a delay every time) until it is canceled.clearInterval(id);, clearTimeout(id); – Accepts a timer ID (returned by either of the aforementioned functions) and stops the timer callback from occurring.

Javascript Graphs and Charts libraries. JavaScript Slideshow - TinySlideshow. Real time data streaming. Js - JavaScript 3D library.