Wednesday, December 10, 2008

Timed Event jQuery plugin

JavaScript programming is strongly connected with the events. I can not remember any case when I used JavaScript without using events. At the same time, it is one of the most challenging parts of work of JavaScript programmer, because different browsers "understand" events in different ways. Fortunately, now we have good JavaScript libraries such as jQuery, which makes development of cross-browser JavaScript applications a trivial task. In particular, jQuery simplified working with events strongly.

But programmers always want more. We always want to write better software, have better programming languages and frameworks. This pushes the industry forward, despite the efforts of some stupid bosses.

When working with events I have often faced tasks when I needed to delay handling of the event event for a certain time (event delaying) or (less frequently) to allow event handling only once for a period of time (event buffering). jQuery does not provide any tools to achieve this (and this is the right solution of developers). As for me, in the process of working on various projects, I tried several solutions for this problem, trying to find the most elegant and universal. Now you can evaluate the result of my work in this area - jQuery plugin called Timed Event.

The plugin enables us to solve two tasks that I mentioned - event delaying and event buffering. To achieve this, you will not have to change the code of event handler. You write handler as you would have written it if you didin't need to implement event delaying or buffering. The rest will be done by Timed Event.

Resources

No comments: