Download the X Distribution File.
xa.para(e, xe, ye, inc, t[, oe]);
Default.
// xAnimation.para r3, Copyright 2006-2007 Michael Foster (Cross-Browser.com)
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
xAnimation.prototype.para = function(e,xe,ye,inc,t,oe) // still experimental!
{
var i = this;
i.tt = t;
if (!t) t = 1000;
i.xe = xe; i.ye = ye; // x and y expression strings
i.par = 0; i.inc = inc || .005;
i.init(e,t,h,h,oe,0,0);
i.run();
function h(i) { // onRun and onTarget
var p = i.e.offsetParent, xc, yc;
xc = (xWidth(p)/2)-(xWidth(e)/2); yc = (xHeight(p)/2)-(xHeight(e)/2); // center of parent
i.e.style.left = (Math.round((eval(i.xe) * xc) + xc) + xScrollLeft(p)) + 'px';
i.e.style.top = (Math.round((eval(i.ye) * yc) + yc) + xScrollTop(p)) + 'px';
i.par += i.inc;
if (!i.tt) i.t += 1000; // yuck!
}
};
xanimation.html - Start page of all xAnimation demos.
By your use of X and/or CBE and/or any Javascript from this site you consent to the GNU LGPL - please read it. If you have any questions about the license, read the FAQ and/or come to the forums.
Forum support is available at the X Library Support Forums.
Cross-Browser.com is the home of X - a cross-browser Javascript library, and many demos, applications, articles and documentation.
If you are using X, XC or anything from this site, show off your work by posting a link in the X Showcase forum.