Get the viewport of a div element
Hi everyone,
i have a div element within another div element. The outer div element is smaller than the inner and has overflow set to scroll so i can scroll the 1000px width and height in my outer div.
- <div style="width: 100px; height: 100px; overflow: scroll;">
- <div style="width: 1000px; height: 1000px;">some text</div>
- </div>
How can i read the current viewport of my outer div element? I want to get the height and width of the upper left corner of the inner width when im scrolling with the outer div.
For example: i scroll down and right 500px height and width. My outer div still remains at 100px height and width but my inner div scrolled to 500px. I hope you understand me?!
Thanks very much in advance