Menu
Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Javascript
How do I manipulate the scroll bars so that a div with content thatchanges size shows the content at
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Shauniwthanau, post: 5000392"] I'm sorry if this is the wrong place to ask this but my justification is that I have seen this done in WPF and I am wondering how to implement the same thing that is cross-browser compliant and using only javascript/CSS/HTML. What I have is a div with overflow:auto, but really could be any container, which is for example is 800*800 px and inside of this div is a SVG image, which changes size. It can fit in the div but it can also get very large, say 5000*5000 px, and I need to manipulate the scrollbars so that when the SVG has changed size the scrollbars adjust so that you are seeing the same location on the SVG that you were seeing before. This is what I would like to reproduce: Initially set the center as the center of the SVG so that when the SVG gets larger then the container the scrollbars automatically scroll to show the center of the SVG. If the user scrolls, then the view-ports center is updated and any changes in size now centers your view-port there. In WPF they were able to access the view-port of the container and using that along with the height and width of the container (used to calculate the center) they were able to accomplish this. Any help would be greatly appreciated. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Javascript
How do I manipulate the scroll bars so that a div with content thatchanges size shows the content at
Top