Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: DIV Scroll ???

  1. #1
    New Coder
    Join Date
    Oct 2002
    Thanked 0 Times in 0 Posts

    DIV Scroll ???

    All i want to know is if we have control over the onscroll event.I know that one can call a event handler on the div onscroll event.But what i want to know here is if i am scrolling upwards or down on the DIV.How could i know the same ?

    I want to know how one can control the scroll of a div
    Suppose i have a div of a fixed height.I construct a table and write the same into the DIV (div.innerHTML).Now i see a vertical scroll bar
    I want to add or remove rows to the table on the onscroll event
    When i sroll down i want to add rows and at the same time when i scroll up i want to reomve rows .Is this possible.

    Any help would be appreciated

  2. #2
    New Coder
    Join Date
    Jun 2003
    Thanked 0 Times in 0 Posts


    I have been using a style class to control scrolling in DIVS that looks like these:
    .ColmScroll {overflow:auto;width:100%;height:100%;}
    .ColmScroll95 {overflow:auto;width:100%;height:95%;}
    .ColmScroll98 {overflow:auto;width:100%;height:98%;}

    In the frames columns, there is usually a div above the scrolling div, that I have a fixed position on, like this:

    .Caption {Display:Block;Width:100%;
    Position:fixed; Top:0px;Bottom:Auto;

    This permits the lower div to scroll under the upper div, without the upper div moving.

    The different height adjustments are needed, as at 100%, the bottom of the scroll doesn't always show up. You have to adjust the height per usage, which seems to be effected by the size of the Caption Div, although 95% seems to work well consistenly.

    This design also compensates for different resolutions and window sizes. I used Class, so I could also input other designs in as an ID.

    <Div Class=ColmScroll95 ID=Colorscheme>


Posting Permissions

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