View Full Version : Script: Page Scroller (aka Custom Scrollbar) - Would like to tweak

Das Christoff
03-23-2006, 09:18 PM
Script: Page Scroller (aka Custom Scrollbar)

This script is great, it's almost exactly what I am looking for. There are only 2 things I am trying to change.

1: Instead of having the page start sliding on mouseover, I would like to have it move a set amount (ie 50px) just once on mouseclick.

2: I would like to have the up arrow at the top of that page, while keeping the down arrow at the bottom.

Basically, I am trying to replace the standard scrollbars with two images that move the info up or down. There may be a script out there that does exactly this, but I haven't found it yet.

03-24-2006, 03:55 AM
<div id="staticbuttons2" style="position:absolute;">
<a href="javascript:scrollwindow('-')"><img
src="arrows_up.gif" border="0"></a>
<div id="staticbuttons" style="position:absolute;">
<a href="javascript:scrollwindow('+')"><img
src="arrows_dn.gif" border="0"></a>


//Page Scroller (aka custom scrollbar)- By Dynamic Drive
//For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
//This credit MUST stay intact for use
//Modified here for top and bottom buttons & onclick activation by
//jscheuer1 in http://www.dynamicdrive.com/forums

var Hoffset=70 //Enter buttons' offset from right edge of window (adjust depending on images width)
var Voffset=60 //Enter button's offset from bottom edge of window (adjust depending on images height) Half this value will be added as top button's offset from top
var theamount=50 //Enter scroll amount per click as integer (Advised: 25-50)

var ieNOTopera=document.all&&navigator.userAgent.indexOf("Opera")==-1
var myspeed=0

var ieHoffset_extra=ieNOTopera? 15 : 0
var cross_obj=document.all? document.all.staticbuttons : document.getElementById? document.getElementById("staticbuttons") : document.staticbuttons
var cross_obj2=document.all? document.all.staticbuttons2 : document.getElementById? document.getElementById("staticbuttons2") : document.staticbuttons2

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body

function positionit(){
var dsocleft=document.all? iecompattest().scrollLeft : pageXOffset
var dsoctop=document.all? iecompattest().scrollTop : pageYOffset
var window_width=ieNOTopera? iecompattest().clientWidth+ieHoffset_extra : window.innerWidth+ieHoffset_extra
var window_height=ieNOTopera? iecompattest().clientHeight : window.innerHeight

if (document.all||document.getElementById){
else if (document.layers){

function scrollwindow(dir){
if (dir=='-')

function initializeIT(){

if (document.all||document.getElementById||document.layers)


Das Christoff
03-24-2006, 05:55 PM
That's perfect. Thanks a lot.