I have some text that is starting at 0,0 on my page and I want it to scroll to the center and once there, call a new function.
When I load the page (moveBook()), my text doesn’t move. The code follows….
var W = (winWidth()/2)
function moveBook() {
var x = xCoord(“Books”);
if (x <= W-125) {
shiftIt(“Books”,10,0);
setTimeout(“moveBook()”,50);
} else {
swapImages();
}
}
function xCoord(id) {
var object=getObject(id);
if (NS4DOM) xc=object.left;
else if (IEDOM) xc=object.style.pixelLeft;
else if (W3CDOM) xc=parseInt(object.style.left);
return xc;
}
function winWidth() {
if (window.innerWidth) return window.innerWidth;
else if (document.documentElement) return document.documentElement.offsetWidth;
else if (document.body.clientWidth) return document.body.clientWidth;
}