Not sure what you mean by "positioned to go along with the picture. ". I might just be looking at it from the wrong angle..
As for moving the scrollbar, yes you can do it with JavaScript. Its a bit tricky, but not too complicated.
If you're working with a vertical scrollbar, heres the properties of the scrollbar.
Assume you have an element (el) of ID = mydiv.
var el = document.getElementById('mydiv'); // div element
var h = el.scrollHeight; // height of div scroll
var y = el.scrollTop; // vertical scroll offset from top (of scrollHeight)
var c = el.clientHeight; // scroll bar height
To change where the scrollbar is you'll just be modifying the scrollTop property of the element (that has the scrollbar you want to move).
Eg:
el.scrollTop + 5; // move vertical scroll 5px down
el.scrollTop - 5; // move vertical scroll 5px up
The scrollTop property shows how many pixels from the top the scrollbar is. So if you want to move it up right to the top, its just el.scrollTop = 0;
However, if you want to move it to the bottom, there is not scrollBottom property, you'll still have to use scrollTop. If you just need it right at the bottom, just make scrollTop an extremely large number like: el.scrollTop = 5000; . That will move it down 5000 px, which is more than any normal screen resolution (I think).
If you want to know specifically how many pixels you are from the bottom, you'll have to use something like:
var el = document.getElementById('mydiv'); // div element
var h = el.scrollHeight; // height of div scroll
var y = el.scrollTop; // vertical scroll offset from top (of scrollHeight)
var c = el.clientHeight; // scroll bar height
var scrollBottom = h - (y + c); // offset of scroll from bottom
or you could make it a property of all HTML elements.. so you can use it withought writing all that code over and over..
HTMLElement.prototype.scrollBottom = function() {
var el = this; // element
var h = el.scrollHeight; // height of element scroll
var y = el.scrollTop; // vertical scroll offset from top (of scrollHeight)
var c = el.clientHeight; // scroll bar height
var scrollBottom = h - (y + c); // offset of scroll from bottom
return scrollBottom;
}
You'd use it like el.scrollBottom();
(not sure how to set just a regular property).
ref: http://www.quirksmode.org/js/doctypes.html
http://www.mozilla.org/docs/dom/mozilla/protodoc.html