Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Apr 2008
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    horizontal scroll thumbnails

    I have image thumbnails pulled out of a database that sits in a div that 300px wide. Each image thumbnail (which sits inside the div) is 53px wide and 40px high. Depending which product is selected by the user the image thumbnails will be displayed in the 300px div.

    The problem i have got is when there are say 8 thumbnails to be displayed i still need them to sit in that div but the user can scroll horizontally (left to right) to view the thumbnails.

    At the moment another row is inserted underneath the top one which is not quite what i am looking for.

    Any ideas on how to accomplish this?

  • #2
    Senior Coder Rowsdower!'s Avatar
    Join Date
    Oct 2008
    Location
    Some say it's everything.
    Posts
    2,027
    Thanks
    5
    Thanked 397 Times in 390 Posts
    Assuming you are using PHP or some server-side script and assuming you have a <ul> wrapped within a containing, static-width <div> (with overflow-x:scroll;) you can set the width of the <ul> dynamically based on your box model calculations (the sum of an individual thumbnail's width, side border, side padding, and side margin) multiplied by the number of thumbnails returned from the DB.

    Other than that, all I can think of is a hacky, non-semantic use of a table.
    Last edited by Rowsdower!; 12-04-2009 at 02:58 PM.
    The object of opening the mind, as of opening the mouth, is to shut it again on something solid. –G.K. Chesterton
    See Mediocrity in its Infancy
    It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
    Seek and you shall find... basically:
    validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting

  • #3
    New Coder
    Join Date
    Apr 2008
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi Guys

    Would i use the same approach to achieve this:

    http://www.beatsbydre.com/picsvids/PicturesVideos.aspx

    This is the end result i would like to get?


  •  

    Posting Permissions

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