I didn't really look at your code, but here's the function I've been using
to center an element:
function centerElement(obj){
var vpDim = getViewportDimensions();
var elemDim = getElementDimensions(obj);
setElementPosition(obj, {'x':((vpDim.w -elemDim.w)/2),'y':((vpDim.h -
elemDim.h)/2)});
}
All credit to Cameron Maxwell who wrote it.
Unless you're doing something funky with your code, I believe this should
work for you.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"MochiKit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---