Dynamically position a DIV over specific text

blakerules

New Member
I am displaying a long, contiguous fragment of text (representing DNA sequence) on a single line in a web page. I'm using a mono-width font and would like to use javascript to dynamically position a DIV at a certain character in the text (say at the 20th character, 50th character, etc). What's the best way to calculate coordinates that I could use to position the DIV? I need the solution to be robust to the user changing font size in their browser.
 
Back
Top