Cancel, Queue and Pause Animations with the GX JavaScript Animation Framework
(Page 1 of 4 )
In this eighth part of a series, I discuss how to cancel, pause and resume animations with the GX JavaScript library. You'll see that performing these tasks, as with many of the tricks you can make the GX library do, is a straightforward process.
Some people do it only for fun, some to deliberately fire up an engaging and healthy debate. In either case, asking a question like "what's the best framework out there?" works remarkably well, whether the question points directly to Java, PHP, CSS or even the JavaScript world (feel free to add your own language/technology to the list).
If you take some time to research the topic, you'll find blogs and forums where multitudes of users declare with brave and passionate feelings why the framework they're using is the best. This diversity of opinions can be used to answer the previous question quickly: in reality, the best framework is the one that best suits your needs. This simple rule applies to different programming languages, be it on the server side or in the always-uncertain client territory.
Naturally, something similar can be said about JavaScript animation frameworks. Nowadays, there are a lot of them that will do the job very well when it comes to implementing attractive effects on web pages, but it's pointless to say that one in particular is better than the others. However, it's fair to stress that a good animation framework does have to fit at least two minimum conditions. First, it must have a flat learning curve, and second, it must come with a decent number of features that permit you to animate HTML elements in an easy and unobtrusive way.
That's exactly the case with GX, a powerful framework developed by Riccardo Degni. It will let you implement a great variety of animations on your (X)HTML documents, based on the functionality of the popular jQuery library.
If you've already read some of the articles that precede this one, then surely at this point you'll have a solid background in how to use the "gx()"method provided by GX to perform a few simple animations on web pages. All of the examples created so far, however, show how to use this method for implementing animations that can't be canceled, paused or resumed at any time. Fortunately, the library will let you accomplish all these things, and even create predefined chains of effects, something known in the GX's jargon as queued animations.
Therefore, in this eighth part of the series I'll be demonstrating how to take advantage of these useful features, so you can start implementing them on your own web site. Let's get going!
Next: Creating controlled effects: queued animations >>
More JavaScript Articles
More By Alejandro Gervasio