<script type="text/javascript">
// Egel 080930 ;)
function getTop(obj) {
var y = obj.offsetTop;
while (obj.offsetParent) {
obj = obj.offsetParent;
y += obj.offsetTop;
};
return y;
};
function adjust(div,obj) {
div = document.getElementById(div);
div.scrollTop = 0; // Opera!
div.scrollTop = getTop(obj) - getTop(div);
};
</script>
<br><br>
<div id="container" style="overflow: auto; width: 320px; height: 240px; background: #eee;">
<img src="" width="240" height="160" onclick="adjust('container',this)" style="background: #f00"><br><br>
<img src="" width="240" height="160" onclick="adjust('container',this)" style="background: #f80"><br><br>
<img src="" width="240" height="160" onclick="adjust('container',this)" style="background: #fc0"><br><br>
<img src="" width="240" height="160" onclick="adjust('container',this)" style="background: #ff0"><br><br>
<img src="" width="240" height="160" onclick="adjust('container',this)" style="background: #0f0"><br><br>
<img src="" width="240" height="160" onclick="adjust('container',this)" style="background: #0ff"><br><br>
<img src="" width="240" height="160" onclick="adjust('container',this)" style="background: #08f"><br><br>
<img src="" width="240" height="160" onclick="adjust('container',this)" style="background: #80f"><br><br>
<br><br><br><br><br><br><br><br>
</div>