Folks,
My script below near-works on both Firefox2 and IE7 (though my end
user base will be Firefox2 intranet users only)... "near-works" means
it does permit me to place my div tag on the screen but not where I
expect.
returnLocation() appears to work - it gives me different numeric
results depending on the location of my id tag'd url.
When I pass these numeric values to place() I would expect that my new
output would overwrite the old output but instead its written
somewhere else on the screen. Can someone tell me why this is the
case?
Cheers!
function place( tagID, across, down )
{
var pointer=returnTagObject( tagID );
pointer.style.position="absolute";
if( across<1 )
{ pointer.style.left = ( pointer.offsetWidth+parseFloat(across) ) +
"px"; }
else
{ pointer.style.left = ( pointer.offsetWidth+across ) + "px"; }
if( down<1 )
{ pointer.style.top = ( pointer.offsetHeight+parseFloat(down) )
+"px"; }
else
{ pointer.style.top = ( pointer.offsetHeight+down ) +"px"; }
return;
}
function returnLocation( tagID )
{ // Return (as a string) the location of tagID (use parseFloat to
reverse it back into integer)
var pointer=returnTagObject( tagID );
return pointer.offsetWidth+":"+pointer.offsetHeight;
}