My application involves appointments. That means the <div> that contains these appointment entries will necessarily have scrollbars, both vertical and horizontal. My goal is to be able to center the last appointment added or edited within the viewport of the browser.
Here's how I'm envisioning the thought process:
When an appointment is added/edited, I will get the appointment <div>'s x-y position, and its width/height. I need to get the browser viewport's width and height. Based on this, I need to calculate and set the vertical and horizontal scrollbars thumb to a certain position so that this appointment that was added/created will somehow appear dead center within the browser viewport, both horizontally and vertically.
Thanks in advance.