There is a nice class embedded in the MooTools core package, the Fx.Transitions. It is used to spice up the default animations in many different way. I won't go into details, there is a cool breakdown about the capabilities of the class.
I'd like to show you how you can pick any transition function and use them outside the Fx classes.
This approach can be handy if you need to trigger other functions or to work with the Canvas element, maybe update some non standard CSS properties.
MooTools.net has a nice new feature, called Forge. It's a code repository for developers who are willing to share their MooTools based projects. At this time, it has only 36 scripts, but I'm sure, that this will be multiplied in a shot time, check AjaxRain.com for instance. It's a great collection of scripts, but it's uncontrolled.
What I like about MooTools Forge, is that they give you a guideline on how to publish you code. The first step is posting the project into GitHub, then you have to add a simple "yml" file to describe your package. You can even define the dependencies. Read more here.
It does 4 things at a time: provide documentation, example codes, demos and download opportunity. Official MooTools projects will be stored here also.
Last day I had to hack a webshop's basket management system, and deleting the items had to be done via AJAX. The problem was, that each call had to wait the previous to be completed, otherwise some products kept in the session. The solution was simple: call the AJAX requests recursively on the 'onComplete' event.
Here is a cleaned up code, using MooTools 1.2.4. Call addAjaxParam() to prepare the ajaxParams array.
var ajaxParams = [];
function addAjaxParam( pid )
{
var obj = {
'option': 'module_shop_action',
'product_id': pid
}
ajaxParams.push( obj );
}
All rights reserved, ©2008-2013 - Built on CodeIgniter framework - Konami codes - Mostly Valid XHTML 1.1 - Valid CSS 2.1