How to determine position (x,y) relative to the page of every character inside spans through javascript?
- by Fernando
This is as simple as I can get.
I will have several spans randomly positioned on the screen through something like:
$(".hidden:first").css('-webkit-transform','rotate('+((0.5-Math.random())*40)+'deg)');
$(".hidden:first").animate({
left: '+=' + (((screen.width-800-224)/2) + Math.random()*800),
top: '+=' + (50+Math.random()*600)
} [...]
and later on I would like to iterate through every char of every of those elements (that are randomly position and have random rotation), and I would need to discover the (x,y) position of every character on the screen so I can colorize it, forming certain draws according to certain functions.
Is this easily achievable? I am really inexperienced at javascript.
Thanks.
Fernando.