Cool scrollbar in HTA

Author Message
AMBience

  • Total Posts : 31
  • Scores: 0
  • Reward points : 0
  • Joined: 7/24/2008
  • Status: offline
Cool scrollbar in HTA Wednesday, July 15, 2009 12:42 PM (permalink)
0
A small and simple scrollbar that lets you set the maximum size, always add\sub 1 when you click an arrow, grab the value (obviously) and change the width of the scrollbar without screwing up the maximum size.
 
It's just a div in a div. The outer div has overflowX set to scroll and overflowY to hidden (these don't work in the <BODY> BTW).  The inner div is just moved to the right, the more you move it the larger the max size is.
 
Oh and maxsize is X*7, then read back as X/7.......because a single arrow click usually adds 7.
 
 <HTML><HEAD><TITLE>Scrollbar By Alan Bond</TITLE><HTA:APPLICATION/></HEAD>
 <BODY>
  <DIV ID="HScroll" STYLE="Position:absolute;Width:400;Height:18;Left:100;Top:100;">
   <DIV ID="HScrollMax" STYLE="Position:absolute;">:-)</DIV>
  </DIV>
 </BODY>
 <SCRIPT LANGUAGE="VBScript">
  
 '---- Set up Horizontal scroller
 With HScroll.style
  
  '---- Resize test
  .Width=200
  
  '---- Show\hide X and Y scrollers
  .OverflowX = "scroll"    
  .OverflowY = "hidden"
  
  '---- Set max size
  Dim Demo: Demo=65536
  HScrollMax.Style.Left=.PixelWidth + (Demo*7)-5
 End With
  
 '---- Show Hscroll value
 Sub HScroll_OnScroll()
  Document.Title = "HScroll=" & Int(Me.ScrollLeft/7)
 End Sub
  
 </SCRIPT>
 </HTML>
 

 
 
#1

    Online Bookmarks Sharing: Share/Bookmark

    Jump to:

    Current active users

    There are 0 members and 1 guests.

    Icon Legend and Permission

    • New Messages
    • No New Messages
    • Hot Topic w/ New Messages
    • Hot Topic w/o New Messages
    • Locked w/ New Messages
    • Locked w/o New Messages
    • Read Message
    • Post New Thread
    • Reply to message
    • Post New Poll
    • Submit Vote
    • Post reward post
    • Delete my own posts
    • Delete my own threads
    • Rate post

    2000-2012 ASPPlayground.NET Forum Version 3.9