Welcome to WebmasterWorld Guest from 54.242.83.7

Forum Moderators: open

Message Too Old, No Replies

Obtain actual rendered margin

Is there a way?

     
12:59 pm on Apr 18, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member trillianjedi is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Apr 15, 2003
posts:7246
votes: 0


Hi guys,

I have an editable DIV with users inserting content and I need to obtain on each keyDown the distance their text is from the right hand margin, dynamically.

Anyone know if this is possible, without using a library like JQuery ?

Thanks!
4:59 pm on Apr 21, 2011 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member jab_creations is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Aug 26, 2004
posts: 3159
votes: 15


You want to use the getComputedStyle method. Also thanks for asking how to do this correctly. :)

- John