Results 1 to 3 of 3

Thread: Javascript Scrollbar

  1. #1
    Join Date
    May 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Javascript Scrollbar

    First off, please excuse my understanding (or lack thereof) of HTMLand DHTML. Thankyou. You've got a great site here and heopefully, with time, I'll be dispensing advice as well as asking for it .

    I'm making a website that appears in a pop-up from a splash page, and need to get a sytem working to scroll the contents scrolling without resorting to intrusive scrollbars. I'm trying to use code from this website (at http://www.dynamicdrive.com/dynamici...gescroller.htm) to get the contents of a layer created in Dreamweaver to scroll using images, but am having trouble getting it to work. I'll put the code on at the end of this message. I've placed the code just before the </div> tag, in which I want the content to go. So, any ideas about what I need to do?

    Code:
    <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 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){
    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(0,myspeed)
    }
    
    function initializeIT(){
    positionit()
    if (myspeed!=0){
    scrollwindow()
    }
    }
    
    if (document.all||document.getElementById||document.layers)
    setInterval("initializeIT()",20)
    
    </script>
    EDIT: I've just realised that this should be in help with DD scripts... I'll do a link to it there, but if any passing MOD could move the topic, I'd be grateful. Thanks.
    Last edited by Rob W; 05-07-2005 at 10:52 AM.

  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'm having trouble following just what the trouble is however, I did notice that:

    Quote Originally Posted by Rob W
    I've placed the code just before the </div> tag, in which I want the content to go
    doesn't sound like:

    Quote Originally Posted by Instructions for this script
    Simply add the below script to the bottom of your page (ie: right above </BODY>):
    Oh, and -

    PLEASE: Include the URL to your problematic webpage that you want help with.
    - John
    ________________________

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

  3. #3
    Join Date
    Nov 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default hi

    if you want to use simple and good looking javascript scrollbar, i made some which you can try.
    i also made small tutorial how to use it. it is cross platform so just try and enjoy.
    http://gondo.webdesigners.sk/javascript-scrollbar/

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
  •