jquery - How to determine position (x,y) relative to the page of every character inside spans through javascript? -


this simple can get.

i have several spans randomly positioned on screen through 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 iterate through every char of every of elements (that randomly position , have random rotation), , need discover (x,y) position of every character on screen can colorize it, forming draws according functions.

is achievable? remembering want (x,y) position of each -character- of span, not (x,y) of span itself. inexperienced @ javascript.

edit: answering own question: managed needed wrapping every single letter inside <span> , later accessing .offset().left , .offset().top through jquery. bad? :p

thanks. fernando.

something might started http://jsfiddle.net/qgrwk/


Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -