Get size and position relative to viewport of element

var rect = obj.getBoundingClientRect(); // Returns an object with the following properties: // rect.left (relative to viewport) // rect.right (relative to viewport) // rect.top (relative to viewport) // rect.bottom (relative to viewport) // rect.width // rect.height

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.