Menu

#1 method to reposition wtText object via javascript

open
nobody
5
2007-09-23
2007-09-23
Gordon
No

Not sure if this is the proper way to move a wtText object once it has been created, but I couldn't see any other easy way to do it.

(added to wt_vector.js)

New function for the wtText prototype:
/**
Sets the x,y location of the text
@param {Number,Number} x,y The x and y location
*/
wtText.prototype.setXY = function(_x,_y)
{

if (isMSIE())
{
this.get("divNode").get("style").left = _x;
this.get("divNode").get("style").top = _y;
}
else
{
$_(this).setAttribute("x", _x);
$_(this).setAttribute("y", _y);
}
}

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.