Pure CSS gallery 2...

Do something cool with CMS? Show us ...
This board is for 'Answers', and the discussion of answers... Not for questions.
Post Reply
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Pure CSS gallery 2...

Post by Dr.CSS »

I was working on Album templates and found this on Dynamic Drive, it's all CSS driven no JS, totally configurable...

http://multiintech.com/cmsms1.1/album.html  look for the CSS one...
cyberman

Re: Pure CSS gallery 2...

Post by cyberman »

Looks nice.

Maybe you can show solution here ;) ... or/and add it as patch in project.
Pierre M.

Re: Pure CSS gallery 2...

Post by Pierre M. »

mark wrote: it's all CSS driven no JS, totally configurable...
No Javascript ! Very good !
Thank you very much Mark.

Pierre M.
KO
Power Poster
Power Poster
Posts: 562
Joined: Mon Nov 06, 2006 7:55 pm

Re: Pure CSS gallery 2...

Post by KO »

This was nice! :D

Br,K
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Pure CSS gallery 2...

Post by Dr.CSS »

OK here is the codes...

Album template... I used the bare minimum, you can probably throw this in a full template...

Code: Select all

{if $returnlink}<p><a href="{$returnlink}">Return to the album index page</a></p>{/if}
<div class="gallerycontainer">
<span class="picturelist">
	{foreach from=$pictures item=picturesrow}
	    {foreach from=$picturesrow item=onepicture}
	    <span class="thumbs"><a class="thumbnail" href=" "> <img src="{$onepicture->thumbnail}" alt="{$onepicture->name} - {$onepicture->comment}" title="{$onepicture->name} - {$onepicture->comment}" width="{$onepicture->thumbnailwidth}" /><span><img src="{$onepicture->picture}" /><br />{$onepicture->name} - {$onepicture->comment}</span></a>
   	   </span><br />
      {if ($onepicture->number==$picturenumber and !$picture)}{assign var=picture value=$onepicture}{/if}
	    {/foreach}
	{/foreach}
</span>
</div>
{if $picturecount==0}No image{/if}
CSS...

Code: Select all

/*Credits: Dynamic Drive CSS Library */
/*URL: http://www.dynamicdrive.com/style/ */

.gallerycontainer{
position: relative;
/*Add a height attribute and set to largest image's height to prevent overlaying*/
}

.thumbnail img{
border: 1px solid white;
margin: 0 5px 5px 0;
}

.thumbnail:hover{
background-color: transparent;
}

.thumbnail:hover img{
border: 1px solid blue;
}

.thumbnail span{ /*CSS for enlarged image*/
position: absolute;
background-color: lightyellow;
padding: 5px;
left: -1000px;
border: 1px dashed gray;
visibility: hidden;
color: black;
text-decoration: none;
}

.thumbnail span img{ /*CSS for enlarged image*/
width:450px;
border-width: 0;
padding: 2px;
}

.thumbnail:hover span{ /*CSS for enlarged image*/
visibility: visible;
top: 0;
left: 110px; /*position where enlarged image should offset horizontally */
z-index: 50;
}
The CSS you may need to change...

.thumbnail span{ /*CSS for enlarged image*/ the box around the large img.
position: absolute;
background-color: lightyellow;  you can change this, it's background color
padding: 5px;  room between large img. and box
left: -1000px;
border: 1px dashed gray;  outside box border, you can change
visibility: hidden;
color: black;  text under image color
text-decoration: none;
}

.thumbnail span img{ /*CSS for enlarged image*/  just the image not the box outside it
width:450px;  size of image, I used a smaller than img. size to constrain it on the page
border-width: 0;
padding: 2px;
}

.thumbnail:hover span{ /*CSS for enlarged image*/
visibility: visible;
top: 0;  from the gallerycontainer
left: 110px; /*position where enlarged image should offset horizontally */  since my images are aligned down the left it's just a little more than the width of the thumbs
z-index: 50;
}


Hope I didn't miss anything... have fun...
Post Reply

Return to “Tips and Tricks”