This article discusses the compatibility issues involved with Window size and scrolling in the major browsers. More importantly, the author provides a nice getScrollXY() function that returns the current scroll position:
http://www.howtocreate.co.uk/tutorials/javascript/browserwindow
The nice thing is that based on getScrollXY, you can create a setScrollXY() function that sets the appropriate value to scroll the page based on your browser.
For IE6, this value is document.documentElement.scrollTop. In a simple test, I was able scroll a page by setting this value. Here is an untested guess at what the set function might look like:
function setScrollXY(x, y) {
if( typeof( window.pageYOffset ) == 'number' ) {
//Netscape compliant
window.pageYOffset = y;
window.pageXOffset = x;
} else if( document.body && ( document.body.scrollLeft ||
document.body.scrollTop ) ) {
//DOM compliant
document.body.scrollTop = y;
document.body.scrollLeft = x;
} else if( document.documentElement && ( document.documentElement.scrollLeft ||
document.documentElement.scrollTop ) ) {
//IE6 standards compliant mode
document.documentElement.scrollTop = y;
document.documentElement.scrollLeft = x;
}
}
In your click events, you can then use getScrollXY to find the current position, then use your set function to add 150 to the appropriate Y.
If it works, all credit to Mark "Tarquin" Wilton-Jones for the great article. If not, I probably fudged it up. ;-)
Response to comment:
Use the functions from the article and the setScrollXY I posted above. Then create a new function to handle your click events:
function scrollOnClick(vAmount) // amount to scroll vertically in pixels.
{
var currentPos = getScrollXY();
setScrollXY(currentPos[0], currentPos[1] + vAmount);
}
Now, in your elements you call scrollOnClick and then return false if necessary to prevent other processing. Here's an example using an anchor tag using the 150 pixel increment you mentioned as the vAmount parameter:
<a href="#" onclick="scrollOnClick(150); return false;" >More...</a>
A better way is to apply a class to all of your links:
<a href="#" class="scroller">More...</a>
Then you can add the click registrations dynamically using jQuery:
<script type="text/javascript">
$(document).ready(function() {
$(".scroller").click(function() {
scrollOnClick(150);
return false;
});
});
</script>
Well, that should do it.