Beautiful Thumbnail Hover Effect : Using Mootools

Thumbnail Effect Thumbnails of photos is very common part of any website. We have seen a lot of innovation and beautiful representation of thumbnails. Recently I came across a beautiful hover effect on thumbnails. Without saying much first see what is this effect.

View Demo

Thumbnail Effect

The Implementation of this effect is given in the following sections.

The HTML

<div class="thumbnail-wrap">
<div class="thumbnail-div">
<div style="background-image: url(5_thumb.jpg);">
   <img class="thumbnail-shadow" src="thumbnail-shadow.png" alt="bottom" />
<div class="sections-overlay">
    <a rel="imagezoom" href="5.jpg">
     <img class="zoom" src="zoom.png" alt="Some Title of the Image 5" />
    </a>
    <a class="readmore" href="#">read more &gt;&gt;</a></div>
</div>
</div>
</div>

I think the code here is self explanatory.

The CSS

The CSS for the effect is a bit lengthy, as lots of hidden elements are involved.

.thumbnail-wrap {
	float:left;
	height:151px;
	margin:30px;
	width:151px;
}
.thumbnail-div {
	background-color:#313131;
	float:left;
	height:146px;
	padding:5px 0 0 5px;
	width:146px;
}
.thumbnail-shadow {
	float:left;
	height:33px;
	width:100%;
}
.thumbnail-div .sections-overlay {
	-moz-background-clip:border;
	-moz-background-inline-policy:continuous;
	-moz-background-origin:padding;
	background:transparent url(thumbnail-overlay.png) no-repeat scroll -40px -300px;
	float:left;
	margin-top:-33px;
}
.thumbnail-div div{
	height:141px;
	width:141px;
}
.sections-overlay {
	background-image:url(readmore-bg.png);
	opacity: 0;
	visibility:hidden;
	background-position: 0px -167px;
}
.thumbnail-div .sections-overlay .zoom {
	margin:60px 0 0 61px;
}
.sections-overlay .zoom {
	border:medium none;
	margin:165px 0 0 312px;
}
.readmore {
	background-image:url(readmore-bg.png);
	color:#FFFFFF;
	display:block;
	float:right;
	font-size:10px;
	margin:17px 0 0 40px;
	padding:5px 10px;
}

The Javascript : Mootools

And Finally the magic of Mootools to get the desired effect. All this effect is doing to decrease the margin-top of "thumbnail-div" by 10px and showing "sections-overlay" div using opacity:1.

$$('div.thumbnail-div').each(function(div){
  div.addEvents({
    'mouseover': function(){
      $(this).tween('marginTop', '-10px');
      $(this).getElements('div.sections-overlay').each(function(d){
        d.morph({opacity: 1, backgroundPosition: "-40px 0px"});
      });
    },
    'mouseout': function(){
      $(this).tween('marginTop', '0px');
      $(this).getElements('div.sections-overlay').each(function(d){
        d.morph({opacity: 0, backgroundPosition: "0px -167px"});
      });
    }
  });
});

Doing just this we'll get such an amazing effect on Thumbnails. This effect is just a demo of the possibilities. One can use the same technique to show the Title of the Image or RunTime and Title of Video Thumbnail.

The whole code is available for download :

Download Thumbnail.zip

Hope you guys will like it. Let me hear new implementation through comments.

If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

Other Posts which you may like:

27 responses to “Beautiful Thumbnail Hover Effect : Using Mootools”

  1. Oskar Krawczyk

    Very, very nice! Although, you might want to change mouseover/mouseout to mouseenter/mouseleave– otherwise the animation gets choppy when moving the cursor around! Proof: http://mooshell.net/bz9RB/

  2. Fabio M. Costa

    yeah yeah very nice effect!

  3. cevarief

    Hi Nitin, The code is simple but the result is really nice. i like it.

  4. Navarr

    I love it, its very beautiful, except for the fact that they raise up too. It kind of moves them away from the mouse, and it doesn’t seem very good for usability.

  5. Phaoloo

    Nice tutorial, Mootools is also awesome and can do what jQuery can.

  6. Oskar Krawczyk

    Acutally @Phaoloo, MooTools can do WAY more than jQ will ever be able to do. But, you know, these are just semantics…

  7. Salih Gedik

    Hey bud! Its awesome Mootools tutorial. i have added into archive

  8. Raju

    Its awesome..! :)

  9. links for 2009-10-13 « Giri’s Blogmarks

    [...] Beautiful Thumbnail Hover Effect : Using Mootools | The Code Dreamer (tags: mootools javascript gallery design) [...]

  10. Create a beautiful thumbnail Hover effect with MooTools | denbagus blog

    [...] very often a part of any Web site. We have seen a lot of innovation and fair presentation of the thumbnail images. Nitin Hayaran recently shown how to create a rollover effect MooTools beautiful [...]

  11. rory

    Very nice, I have never used mootools before is it very easy to use? Ive seen a couple of examples of great things you can do with moo, does anyone know a site that I can get mootools tutorials from?

  12. Create Beautiful Thumbnail Hover Effect using Mootools | Internet, Marketing, Enterprenuership

    [...] Beautiful Thumbnail Effect is just a demo of the possibilities. One can use the same technique to show the Title of the Image or RunTime and Title of Video Thumbnail. [...]

  13. Build Beautiful thumbnail Hover Effects with Mootools | bijusubhash.com

    [...] Beautiful Thumbnail Effect is just a demo of the possibilities. One can use the same technique to show the Title of the Image or RunTime and Title of Video Thumbnail. [...]

  14. Another Beautiful Thumbnail Hover Effect : Using Mootools | The Code Dreamer

    [...] size: "large", google_analytics: "true" } Some days back I wrote a post regarding "Beautiful Thumbnail Hover Effect". On getting such a good response about the javascript effect I am again presenting a different [...]

  15. Alex

    I was wondering if this is achievable using mootoools 1.1 as well? (stuck with it unfortunately on joomla) but this effect is what i always needed!

  16. Free web resources – Net-Kit.com » Blog Archive » 15 Excellent thumbnail gallery effects

    [...] 2. Beautiful Thumbnail Hover Effect : Using Mootools [...]

  17. Elena

    Very beautiful, thanks!

  18. Elena

    Very beautiful, thanks!

  19. Create Beautiful Thumbnail Hover Effect using Mootools « Jbloo

    [...] Beautiful Thumbnail Effect is just a demo of the possibilities. One can use the same technique to show the Title of the Image or RunTime and Title of Video Thumbnail. [...]

  20. john

    this is awesome, thank you!!!

  21. 14 Most Powerful MooTools Plugins and Tutorials in 2009 | JoySpan Magazine

    [...] Tutorial | Demo [...]

  22. create flash website

    very useful plugin!
    thanks!

  23. maurice

    this is good, thank you

  24. Website Developer

    Nice job Nitin. Wish U good luck… : )

Leave a Reply

Subscribe Me

Google Custom Search