...

View Full Version : horizontal scroll thumbnails



robert475
12-04-2009, 10:46 AM
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?

Rowsdower!
12-04-2009, 01:55 PM
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.

robert475
12-07-2009, 12:16 PM
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?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum