SitePoint Sponsor

User Tag List

Results 1 to 17 of 17

Thread: Scrolling div

Hybrid View

  1. #1
    SitePoint Wizard
    Join Date
    Dec 2004
    Location
    At My Desk!!
    Posts
    1,642
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Scrolling div

    Hey guys, the main purpose of my question is so I can style the scroll bar. I cant use CSS as it wont validate so I was wondering if someone can point in the right direction to make a scrolling box using javascript. So I would use an image for the bar.

    Thanks in advance
    "Am I the only one doing ASP.NET in Delphi(Pascal)?"

  2. #2
    SitePoint Guru Rob_D's Avatar
    Join Date
    Oct 2006
    Location
    UK
    Posts
    882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by webnoob View Post
    I cant use CSS as it wont validate
    What do you mean it won't validate?

  3. #3
    SitePoint Guru Rob_D's Avatar
    Join Date
    Oct 2006
    Location
    UK
    Posts
    882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by webnoob View Post
    I cant use CSS as it wont validate
    What do you mean, it won't validate? CSS is valid and you can use overflow:scroll or overflow:auto

  4. #4
    SitePoint Evangelist
    Join Date
    Mar 2006
    Location
    Sweden
    Posts
    451
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    He probably meant styling the colors of the scrollbar.

  5. #5
    SitePoint Wizard
    Join Date
    Dec 2004
    Location
    At My Desk!!
    Posts
    1,642
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by wysiwyg View Post
    He probably meant styling the colors of the scrollbar.
    Correct, although you can style the scrolling bars you need to use an IE fix and this is the part that doesn't validate
    "Am I the only one doing ASP.NET in Delphi(Pascal)?"

  6. #6
    SitePoint Wizard
    Join Date
    Dec 2004
    Location
    At My Desk!!
    Posts
    1,642
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the link, it seems like it will do what I require Ill get back if its a problem. Thanks guys
    "Am I the only one doing ASP.NET in Delphi(Pascal)?"

  7. #7
    SitePoint Guru Rob_D's Avatar
    Join Date
    Oct 2006
    Location
    UK
    Posts
    882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry webnoob, didn't read the post properly.

  8. #8
    SitePoint Guru Rob_D's Avatar
    Join Date
    Oct 2006
    Location
    UK
    Posts
    882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Found this on Sitepoint.

  9. #9
    SitePoint Evangelist
    Join Date
    Mar 2006
    Location
    Sweden
    Posts
    451
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, that's what he didn't want to do, since that is only supported by IE, and it breaks validation.

  10. #10
    SitePoint Wizard Pepejeria's Avatar
    Join Date
    Jan 2005
    Location
    Too far up north
    Posts
    1,566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by wysiwyg View Post
    Well, that's what he didn't want to do, since that is only supported by IE, and it breaks validation.
    Opera also support this.

  11. #11
    SitePoint Wizard
    Join Date
    Dec 2004
    Location
    At My Desk!!
    Posts
    1,642
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well looking through the script you posted through, this would be just the same as using CSS as this just styles it using css but from JavaScript.

    Does anyone know of any tutorials for this that don't use the css properties, basically just an image that you can move up and down to do the same thing?

    Thanks in advance
    "Am I the only one doing ASP.NET in Delphi(Pascal)?"

  12. #12
    SitePoint Wizard Pepejeria's Avatar
    Join Date
    Jan 2005
    Location
    Too far up north
    Posts
    1,566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So only because of validation, that seems to be incredible important for you, you want to use JavaScript scroll? Own JavaScript scrolls by pressing images feels a bit outdated. If validation is so important for you, what about the users that have JavaScript disabled? They will not be able to scroll the content if you use a JavaScript solution.

  13. #13
    SitePoint Wizard
    Join Date
    Dec 2004
    Location
    At My Desk!!
    Posts
    1,642
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I know what you mean and it does seem like im being a little ridiculous, but all the sites I make validate and this must be the case here. JavaScript being turned off is not really an issue as the customer has requested quite alot of JavaScript throughout the site anyway, and the majority of the targeted market will have JavaScript turned on anyway.

    Unfortunately this is what I have to work with as the customer is a programmer he thinks he knows best
    "Am I the only one doing ASP.NET in Delphi(Pascal)?"

  14. #14
    SitePoint Wizard Pepejeria's Avatar
    Join Date
    Jan 2005
    Location
    Too far up north
    Posts
    1,566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why don't you then apply the CSS with JavaScript to avoid validaton failure (see article above)?

    If you go for the complete JavaScript scroll solution, you should get tons of results if you google a bit.

  15. #15
    SitePoint Wizard
    Join Date
    Dec 2004
    Location
    At My Desk!!
    Posts
    1,642
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I thought that if you apply the CSS using Javascript it will still have the same effect as the styling is applied to the page? Am I wrong?

    I've been googling but cant seem to find a decent tutorial on this...keep looking
    "Am I the only one doing ASP.NET in Delphi(Pascal)?"

  16. #16
    SitePoint Wizard Pepejeria's Avatar
    Join Date
    Jan 2005
    Location
    Too far up north
    Posts
    1,566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Read the article that Rob_D recommended. If you apply the CSS with JavaScript you will get the colored scrollbars without breaking validation. This since it will not be included in your "pure" CSS file.

  17. #17
    SitePoint Wizard
    Join Date
    Dec 2004
    Location
    At My Desk!!
    Posts
    1,642
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    :O Thanks ill go take a look
    "Am I the only one doing ASP.NET in Delphi(Pascal)?"


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
  •