Web Analytics Made Easy -
StatCounter Re-orienting the buttons in the custom scrollbar - CodingForum

Announcement

Collapse
No announcement yet.

Re-orienting the buttons in the custom scrollbar

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Re-orienting the buttons in the custom scrollbar

    How is it possible, using the script from dd below, to use absolute pixel locations instead of horizontal and vertical offsets? In other words, I want to orient the buttons from the left and top and not the right and bottom.

    ---------------------------

    <div id="staticbuttons" style="position:absolute;">
    <a href="javascript:" onmouseover="myspeed=-thespeed" onmouseout="myspeed=0"><img
    src="arrows_up.gif" border="0"></a><br>
    <a href="javascript:" onmouseover="myspeed=thespeed" onmouseout="myspeed=0"><img
    src="arrows_dn.gif" border="0"></a>
    </div>

    <script>

    //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

    var Hoffset=70 //Enter buttons' offset from right edge of window (adjust depending on images width)
    var Voffset=80 //Enter buttons' offset from bottom edge of window (adjust depending on images height)
    var thespeed=3 //Enter scroll speed in integer (Advised: 1-3)

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

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

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

    if (document.all||document.getElementById){
    cross_obj.style.left=parseInt(dsocleft)+parseInt(window_width)-Hoffset
    cross_obj.style.top=dsoctop+parseInt(window_height)-Voffset
    }
    else if (document.layers){
    cross_obj.left=dsocleft+window_width-Hoffset
    cross_obj.top=dsoctop+window_height-Voffset
    }
    }

    function scrollwindow(){
    window.scrollBy(0,myspeed)
    }

    function initializeIT(){
    positionit()
    if (myspeed!=0){
    scrollwindow()
    }
    }

    if (document.all||document.getElementById||document.layers)
    setInterval("initializeIT()",20)

    </script>
Working...
X