Site Links
Home
Features
Documentation
Pricing & Order
Members Area
Support Options
Who's Online
3 Registered (blaaskaak, driv, 1 invisible), 28 Guests and 25 Spiders online.
Key: Admin, Global Mod, Mod
Top Posters
Gizmo 11678
Rick 7551
Ian 4099
Mark S 3969
ntdoc 3102
Sirdude 2041
jgeoff 1876
David Dreezer 1750
driv 1557
AllenAyres 1523
Latest Photos
Carrie - So Very
Testing
Test Photo
4TH of July at the river!
Test shots from D300 part 3
Topic Options
Rate This Topic
#214083 - 06/06/08 06:39 AM Gallery Thumbnail Backgrounds
Flaming Carrot Offline
stranger

Registered: 10/07/05
Posts: 18
Loc: United Kingdom
Hi there,
Purely an aesthetics question, is there a way I can make thumbnails in the gallery section display with a background of...



For landscape images, and...



So for example, the landscape images displays like this...



I could wrap the thumbnails within a div with those images set as a css background and some padding, but there are obviously the 2 orientations of images: landscape and portrait, and they are dynamically created.

Does part of the UBBthreads code handle the placing of the 2 different image orientations or are they purely produced within GD2/ImageMagick?

Cheers,
Phil

Top
#214087 - 06/06/08 08:48 AM Re: Gallery Thumbnail Backgrounds [Re: Flaming Carrot]
Sirdude Moderator Offline


Registered: 04/19/07
Posts: 2041
Loc: SoCal, USA
with the proper css framing technique, it wouldn't matter landscape/portrait. the frame would be elastic..

although you chose a specific frame look that seems not to lend itself to elasticity .. at least the bottom part looks that way.

:2c:
_________________________

A taxpayer voting for Obama is like a chicken voting for Colonel Sanders.

Top
#214133 - 06/07/08 12:58 AM Re: Gallery Thumbnail Backgrounds [Re: Sirdude]
Flaming Carrot Offline
stranger

Registered: 10/07/05
Posts: 18
Loc: United Kingdom
OK I have created a solution, it involves using another table which I tend to avoid usually but as the rest of UBBthreads is table based another one is not going to make any difference really.

So first decide on the minimum width a thumbnail will be, so in my case portrait thumbnails have a width of 93px, make an image slice with an extra 5px either side (so 103px) as below...



Then create the table code with padding/border css on the image for the other parts of the shadowing...

Html:
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<div>
<img src="/thumbnail.jpg" alt="Image" style="border-right:2px solid #e6e6e6; border-left:2px solid #e6e6e6;padding:3px;"/>
</div>
</td>
</tr>
<tr>
<td>
<img src="thumb-shadow.gif" alt="Shadowing" width="100%" height="3" />
</td>
</tr>
</table>


As the div wrapping the image is a block element, this forces the table width to the width of the image (plus the css padding/borders). The shadow image in the second table row is set to a width of 100%, so extends to the width of the table element. If you place an image with a larger width in the div the shadow image extends in width as desired.

Not the most graceful code but it works, see it in action here.

Top


Shout Box

Recent Topics
Community Spotlight
by Thelockman
Yesterday at 08:04 AM
Protecting Board from hackers
by duquesne
Yesterday at 04:48 AM
Change New Topic text
by MLD
08/25/08 04:59 PM
Reason for deleting a thread
by MattUK
08/24/08 09:40 PM
Adding rss feed to a custom portal island
by alex26101
08/23/08 09:29 PM
Forum Stats
4016 Members
33 Forums
30842 Topics
156619 Posts

Max Online: 978 @ 06/24/07 08:19 PM