Question: Have you ever wanted to neatly display a few lines of text about an image in your site but didn’t want to compromise on the design of your overall layout? In today’s post I’m going to show you how to create a useful information-rich jQuery Image Gallery that solves that problem. The best part of it is that it’s so simple to write up that all you’ll need are jQuery’s excellent .hover() and .animate() functions to get it up and running.
You can view a live MTV themed demo of what we’re going to create here or see the screenshot below.
(Click the image above to view full-size version)
In User-Interface design we’re always trying to push the envelope with new and interesting ways of presenting interfaces that users are used to seeing. One such interface is the traditional image gallery. You can find them pretty much everywhere..social networks, shopping, e-commerce ..even porn (not that I would ever dream of looking at anything like that!). The question is.. how do you allow a user to still get all the information they want without having to sacrifice on your UI or design?. The answer, is by hiding that information in your interface, but keeping it accessible.
Let’s take a look at the following wirefame for today’s jQuery component.
What we’re going to try achieving is having our full-size gallery image occupy the entire area of the wire-frame in our default view (“A”). What the user doesn’t know is that the image is actually contained in a div with more information about it (which you can see in the area denoted by “Header” and “Text goes here”).
When the user hovers over this image we’re going to animate/resize it to occupy the thumbnail space (“B”) you see above. This will allow the user to view all the information they want about it. They can then return back just by moving their cursor outside of the image pane.
Now that we know what we’re building, let’s code it up!.
HTML for the gallery:
![]()
Taylor Swift
Taylor Alison Swift (born December 13, 1989) is an American country pop singer-songwriter and actress.![]()
Rihanna
Rihanna (born February 20, 1988) is a Barbadian R&B recording artist and model born in Saint Michael, Barbados.![]()
Black Eyed Peas
The Black Eyed Peas is a Grammy Award winning hip hop group that formed in Los Angeles, California in 1995.![]()
Lady Antebellum
Lady Antebellum is an American country music group formed in Nashville, Tennessee in 2006.![]()
Lady Gaga
Lady Gaga is an American recording artist who rose to fame with her first two singles "Just Dance" and "Poker Face".![]()
The Killers
The Killers is an American rock band from Las Vegas, Nevada, formed in 2002 who have sold over 16 million records worldwide.
CSS:
.galleryContainer
{
width: 1024px;
}
.galleryImage {
background-color:black;
width:325px;
height:260px;
overflow:hidden;
margin:5px;
float:left;
}
.info{
margin-left:10px;
font-family:arial;
padding:3px;
}
.info h2{
color:gray;
}
.info p {
color:white
}
.clear {
clear:both;
margin-top:10px;
}
jQuery:
$(document).ready(function()
{
$('.galleryImage').hover(
function()
{
$(this).find('img').animate(
{ width:100,
marginTop:10,
marginLeft:10
}, 500);
},
function()
{
$(this).find('img').animate(
{width:325,
marginTop:0,
marginLeft:0
},300);
});
});
and that’s it!. By using jQuery’s always-useful animate() and hover() functions we’re able to define simple behaviours that shrink the size of the overall image and re-position it for more information to be visible.
You can now download the source files or view the demo to see what we’ve created.
Why do I think this is a better solution, than say, something that just moves the image completely off-screen?. Well, It’s really a question of context.
If you’re reading about a particular topic, no matter how short he piece of text on it is, allowing the user to retain the context of that text (in this case the image in thumbnail form) lets them to easily remember why they hovered over it or what took their interest.
This is probably more important in interfaces where you’re clicking through to see more images, like a Facebook Photo Album – eg. just because that folder cover has a fun picture on it doesn’t mean the rest of it’s contents are!. Thats where a descriptive caption comes in handy and why I think this isn’t a bad idea for a user interface.
I hope you found this article useful!. If so, please feel free to share or leave a comment below. Thanks!
-Addy.

Pingback: Zoom-Info – How To Create An Informative Image Gallery With jQuery & CSS | DesignerLinks | Home to Web design news, jQuery Tutorials, CSS tutorials, Web Designing tutorials, JavaScript tutorials and more!
nice effect, so smooth
thanks for share ^_^'
No problem! I hope it comes in useful
love it!
Love it!!
Thank you arvind!
Very nice! Thanks.
You're welcome! I'm very glad you liked it.
Man u are big!! It's nice very nice love u tuts
I will re tweet this … do more link u on my blog. It's great more tuts from u !! 
Regards
From Poland
I'm happy to hear you like the tutorials!
Thanks for the re-tweet and mentions. I appreciate them
Really a nice one! Very usable! Thanx!!
You're very welcome, Kristel.
Great demo and tutorial, thanks for posting it. I have a question though. I'm trying to implement this but the source images aren't all the same dimensions. The overflow: hidden works well for this but after hovering over and then removing the mouse the image returns to proportions for the original image and not how it appeared before the mouseover so as a result some images show part of the text underneath. Do you have any suggestions for this? Thanks again for the great tutorial.
Hi Mike. I'm glad to hear the tutorial was useful.
Correct me if I've understood what you're trying to achieve, but effectively you're trying to use this effect with a set of source images that aren't all the same size and thats resulting in a few quirks with the way the animated effects work.
What I would probably do in that case is one of a few different things. You've mentioned trying to use overflow:hidden, but how about having each of the of the images appear as the background-image property of a set of div's? This effect works best if you set a frame size for the overall image that you want to target. You can then set each of the div's to have an appropriately positioned background-image and because you're not trying to resize the differently sized images, just the same sized divs, you should be able to achieve the effect you're after.
I hope that helps!
Thanks for the reply Addy. I'll give your suggestion a shot this afternoon and post back how it goes and an example if it works out. Thanks again.
Pingback: Information Rich Image Gallery Using CSS & jQuery | Open Source Resources for Designers & Developers | Greepit.com
very amazing customization jQuery image gallery, testing it, working fine
Thanks, Ryan. I'm glad you like it!
You may want to add .stop() before the animate function to avoid the repeated animation when you hover the image more than 2 times
<pre>
$(this).find('img').animate
</pre>
Sorry – $(this).find('img').stop().animate
Pingback: ITキヲスク | 2010年4/4~4/10の週間ブックマーク
Pingback: Tutorial – Como crear una galería informativa con zoom de imagen con jQuery y CSS | Recursos para Diseñadores Gráficos y Web | Creativos Online
Pingback: Zoom-Info, imágenes dinámicas con texto - VitaminaWEB.com
Pingback: ZoomInfo: Image Gallery in jQuery & CSS
Great man, love it…kepp it up…ver well explained…
Thank you!
Well this is great. thanks for all the good stuff. Jquery is the best.
I love it thank's
thanks from Holland
Pingback: Zoom-Info – Imágenes ricas en información- Noticias del Cerebro Digital
good work budy… seems to be a good example
nice work
include in just 3 minutes
Pingback: jQuery tuts en inglés | gorkaerrea.com | diseño bilbao
Pingback: Zoominfo, más información en tus imágenes
Pingback: Zoom-Info – Imágenes ricas en información - slidebox
Pingback: Zoom-Info – Imágenes ricas en información » Letmon.com
Pingback: Zoom-Info: Informative Image Gallery Joomla Module | Magspice.com. free Icons, Colorful Wallpapers, Vector Backgrounds, Creative Fonts Typography , Wordpress Themes and Plugins, Logo Design Inspiration, Websites Showcase, Inspiration, Photography Resource
Pingback: Css ve Jquery ile tasarlanmis muhtesem resim galerisi - Aciklamasi, Ingilizce, Demo, Jquery, Websitelerinizin, Ucretsiz - Paylasimin Adresi
Pingback: Cool and Useful jQuery Image and Content Sliders and Slideshows - Noupe Design Blog
Pingback: Cool and Useful jQuery Image and Content Sliders and Slideshows | 20 One | Designers Blog20 One | Designers Blog
Pingback: Cool and Useful jQuery Image and Content Sliders and Slideshows
Pingback: Sacima鲨鳍马工作室 » Blog Archive » Cool and Useful jQuery Image and Content Sliders and Slideshows
Pingback: Css ve Jquery ile tasarlanmis muhtesem resim galerisi » Aciklamasi, Ingilizce, Demo, Jquery, Websitelerinizin » Paylasim Portali
Pingback: 60款很酷的 jQuery 幻灯片演示和下载 | 刀侠剑客
Pingback: 60款很酷的 jQuery 幻灯片演示和下载 | Artfans视觉杂志
Pingback: 60款很酷的 jQuery 幻灯片演示和下载 – 峰随意动,尽从容!
Pingback: 非常實用又漂亮的jQuery工具 (可免費下載喔!!) « 我是派
Pingback: 59款很酷的jQuery幻灯片演示和下载 | Yovae Blog
Pingback: 190+ Best! jQuery Slider tools – Part IV - Pixel2Pixel Design
Pingback: 北京上升力网络科技有限公司博客 » 60款很酷的 jQuery 幻灯片演示和下载
Pingback: 60款很酷的 jQuery 幻灯片演示和下载
Pingback: 60款jQuery 幻灯片 | 秦唐网
Pingback: 60款很酷的jQuery 幻灯片演示和下载 « Wondye's Blog
Pingback: 60款很酷的 jQuery 幻灯片 | 喜乐优
I signed approximately your rss feed! Will you article additional about the concept?
Aw, this was a really nice post. In idea I want to put in writing like this moreover – taking time and precise effort to make a very good article… however what can I say… I procrastinate alot and certainly not appear to get one thing done.
Pingback: 酷的60款很 jQuery 幻灯片插件【附演示和下载地址】 | 来找吧
Pingback: A1JavaScripts.com » Zoom Info – A useful information-rich jQuery Image Gallery
Pingback: 60款很酷的 jQuery 幻灯片演示和下载 « 爱酷的空间-IT