SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Enthusiast KingOfMyCastle's Avatar
    Join Date
    May 2005
    Posts
    91
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Up/Down hover scroll buttons for div?

    Hi! I'm hoping to add a div into my site (e.g 800px high) but that only shows a small amount (e.g. 200px) of height. Then I'd like to position two buttons next to the div that can move the contents up or down when they are hovered over.

    I've seen it used hundreds of times on Flash sites but I haven't yet found a javascript solution. Maybe I'm using the wrong search terms.

    Has anybody seen a solution for this?

    Thank you.
    John King - King Websites

  2. #2
    code ninja hamstu's Avatar
    Join Date
    Nov 2002
    Location
    Montréal, Canada
    Posts
    375
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey John,
    You'll be needing the scrollHeight and scrollTop properties of your div. When you change scrollTop it changes the current scrolling location, scrollHeight is the total height of your div (even what you don't see).

  3. #3
    SitePoint Enthusiast KingOfMyCastle's Avatar
    Join Date
    May 2005
    Posts
    91
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Right, seems like I might have to learn a bit of javascript then.

    I have seen a few examples so I'm going to attempt to use their code:

    http://www.dyn-web.com/dhtml/scroll/scroll-rel.html

    http://2ndmind.net/scw/

    http://www.dynamicdrive.com/dynamicindex11/scrollc2.htm

    Thanks for your help.
    John King - King Websites


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
  •