Results 1 to 5 of 5

Thread: Page Scroller (aka Custom Scrollbar)

  1. #1
    Join Date
    Jan 2006
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Page Scroller (aka Custom Scrollbar)

    http://www.dynamicdrive.com/dynamici...gescroller.htm

    I want to know how can i change this script to "left to right mode",because the page is not up to down

    Thanks a lot

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I found this demo page lying around in my scripts trial area, it seems to fit the bill:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
    <html>
    <head>
    <title>Left-Right Scroller</title>
    
    </head>
    <body>
    <div>
    <table>
    <tr>
        <td><img src=1st.jpg width=1500 height=1000 border=0 alt=" " title=" "></td>
    </tr>
    </table>
    <table id="staticbuttons" style="position:absolute;cursor:pointer;"><tr><td>&nbsp;<a 
    onmouseover="myspeed=-thespeed" onmouseout="myspeed=0"><img src="arrows_lt.gif" 
    border="0" alt=""></a></td><td>&nbsp;<a onmouseover="myspeed=thespeed" 
    onmouseout="myspeed=0"><img src="arrows_rt.gif" border="0" alt=""></a></td></tr></table>
    
    <script>
    
    //Page Scroller (aka custom scrollbar)- By Dynamic Drive
    //For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
    //Modified for Horizontal Scrolling by jscheuer1 in http://www.dynamicdrive.com/forums
    //This credit MUST stay intact for use
    
    var Hoffset=110 //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 iecompattest(){
    return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
    }
    
    iecompattest().style.overflowX='hidden'
    
    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){
    cross_obj.style.left=parseInt(dsocleft)+parseInt(window_width)-Hoffset+"px"
    cross_obj.style.top=dsoctop+parseInt(window_height)-Voffset+"px"
    }
    else if (document.layers){
    cross_obj.left=dsocleft+window_width-Hoffset
    cross_obj.top=dsoctop+window_height-Voffset
    }
    }
    
    function scrollwindow(){
    window.scrollBy(myspeed,0)
    }
    
    function initializeIT(){
    positionit()
    if (myspeed!=0){
    scrollwindow()
    }
    }
    
    if (document.all||document.getElementById||document.layers)
    setInterval("initializeIT()",20)
    
    </script>
    
    </div>
    </body>
    </html>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jan 2006
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank you very much!!!!!!

  4. #4
    Join Date
    May 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Is it at all possible to replace both the horizontal and vertical scrollbars with this script? I've tried playing around with it a bit, but can't work it out. The problem is that one of bars won't work or both of the bars will do the same thing.

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by lanithro
    Is it at all possible to replace both the horizontal and vertical scrollbars with this script? I've tried playing around with it a bit, but can't work it out. The problem is that one of bars won't work and everything will be out of position.
    Sounds like you may have a script conflict. In theory it is possible to replace the scrollbars but, you should leave them there anyway for folks without javascript, or make it so that the scrollbars are only removed if the script executes successfully.

    Please post a link to the page on your site that contains the problematic script so we can check it out.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •