21 lines
556 B
JavaScript
21 lines
556 B
JavaScript
// xLeft, Copyright 2001-2005 Michael Foster (Cross-Browser.com)
|
|
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
|
|
|
|
function xLeft(e, iX)
|
|
{
|
|
if(!(e=xGetElementById(e))) return 0;
|
|
var css=xDef(e.style);
|
|
if (css && xStr(e.style.left)) {
|
|
if(xNum(iX)) e.style.left=iX+'px';
|
|
else {
|
|
iX=parseInt(e.style.left);
|
|
if(isNaN(iX)) iX=0;
|
|
}
|
|
}
|
|
else if(css && xDef(e.style.pixelLeft)) {
|
|
if(xNum(iX)) e.style.pixelLeft=iX;
|
|
else iX=e.style.pixelLeft;
|
|
}
|
|
return iX;
|
|
}
|