Site Links
Home
Features
Documentation
Pricing & Order
Members Area
Support Options
Who's Online
2 registered (ScriptKeeper, 1 invisible), 16 Guests and 24 Spiders online.
Key: Admin, Global Mod, Mod
Featured Member
Registered: 11/02/08
Posts: 2
Top Posters (30 Days)
Ruben Rocha 165
Rick 116
Gizmo 105
Thelockman 61
driv 50
AllenAyres 35
ScriptKeeper 34
Mark S 30
Ian 30
phoebe 25
Latest Photos
My Home System
test photo gallery
Bernese Mountain Dogs
My Daimler
Dorado and shark
Topic Options
Rate This Topic
#214083 - 06/06/08 06:39 AM Gallery Thumbnail Backgrounds
Flaming Carrot Offline
stranger

Registered: 10/07/05
Posts: 22
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: 2066
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:
_________________________


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

Registered: 10/07/05
Posts: 22
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

Today's Birthdays
Eric Flyxe, mark_l_88@yahoo.com
Recent Topics
restricting a media tag to a single forum...
by bakerzdosen
Yesterday at 12:52 PM
Recover topics??
by femistyle
Yesterday at 12:22 PM
duplicate entries in viewmessage.php lang file (7.4.1)
by alnadabi
Yesterday at 05:54 AM
Order of variables in language files should be permanent
by alnadabi
Yesterday at 05:12 AM
How do I set Moderation Queue for an individual user?
by luket
11/20/08 11:28 AM
Forum Stats
4249 Members
33 Forums
30488 Topics
154661 Posts

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