scrollTo() plugin: how to scroll to element until it will be in the bottom of the page, not top.

scrollTo() plugin: how to scroll to element until it will be in the bottom of the page, not top.


Hi All
I'm trying to use scrollTo() plugin.
When user clicks on some button, I create a new element in the DOM at
some place below this button.
And if it's outside of visible page area - I want page to be scrolled
to that new element.
But I don't want to scroll till the element will be in the left-top
corner, but till it will be in the bottom of the visible page area,
but with all content shown.
I probably need to specify somehow position = the element - window
height + element height.
But I'm not so good in JavaScript.
Any help will be greatly appreciated!
Ivan..