Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-04-2009, 10:46 AM   PM User | #1
robert475
New Coder

 
Join Date: Apr 2008
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
robert475 is an unknown quantity at this point
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?
robert475 is offline   Reply With Quote
Old 12-04-2009, 01:55 PM   PM User | #2
Rowsdower!
Senior Coder

 
Rowsdower!'s Avatar
 
Join Date: Oct 2008
Location: Some say it's everything.
Posts: 2,007
Thanks: 5
Thanked 395 Times in 388 Posts
Rowsdower! has a spectacular aura aboutRowsdower! has a spectacular aura aboutRowsdower! has a spectacular aura about
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.
__________________
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

Last edited by Rowsdower!; 12-04-2009 at 01:58 PM..
Rowsdower! is offline   Reply With Quote
Old 12-07-2009, 12:16 PM   PM User | #3
robert475
New Coder

 
Join Date: Apr 2008
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
robert475 is an unknown quantity at this point
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?
robert475 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:32 PM.


Advertisement
Log in to turn off these ads.