/*
* Copyright (C) 2005 - 2011 Jaspersoft Corporation. All rights reserved.
* http://www.jaspersoft.com.
*
* Unless you have purchased a commercial license agreement from Jaspersoft,
* the following license terms apply:
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
/**
* A collection of Common Animation Utilities.
*/
///////////////////////////////////////////////////////////////////////////////////////////////////////
// ** See also: common.js **
///////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////
// Script.aculo.us helpers
///////////////////////////////////////////
///////////////////////////////////////////
// Move
///////////////////////////////////////////
/**
* Move to absolute position
* @param {Object} element or element id
* @param {Object} toX
* @param {Object} toY
* @param {Object} duration in seconds (default 1)
*/
function moveTo(element, toX, toY, duration) {
new Effect.Move($(element),{sync: false, x: toX, y: toY, mode: 'absolute', duration: (duration?duration:0.2)});
}
/**
* Move by given x and y deltas
* @param {Object} element or element id
* @param {Object} toX
* @param {Object} toY
* @param {Object} duration in seconds (default 1)
*/
function move(element, moveX, moveY, duration) {
new Effect.Move($(element),{sync: false, x: moveX, y: moveY, mode: 'relative', duration: (duration?duration:0.2)});
}
/**
* Move an array of elems in parallele by given x and y deltas
* @param {Array} elements, array of elements to move
* @param {Object} toX
* @param {Object} toY
* @param {Object} duration in seconds (default 1)
*/
function moveMany(elements, moveX, moveY, duration){
var effects = [];
for (var i=0; i