30 Mar, 2009

How to make a beautiful portfolio gallery using jQuery Animate !

Posted by: Mahbub In: misc

Doing a portfolio page with Flash on your website has become kind of obsolete. These days with Faster machines and new generation browser can really kick some ass with Javascript and CSS.  JQuery has very neat way to deal with some effects. All the animations stem from the base method called “animate”. It animates, tweens the properties of DOM elements. To make the long story short take a look at this.

portfolio_demo

So, you have already clicked and saw right? Ok, if you look at the code, it’s fairly simple.

	$(document).ready(function(){
		var hover_in_easing="easeOutExpo";
		var hover_out_easing="easeOutBounce";
		$(".info_container").show();
		$("div.portfolio_div").hover(function(){
			$(this).find(".info_container").animate({top:"0px"},{duration: 400, easing: hover_in_easing});
		},function(){
			$(this).find(".info_container").animate({top:"100px"},{duration: 500, easing: hover_out_easing});
		});
                // The 100 px is the size of the mask
	});

It uses animate function to animate the mask over the image which is kept hidden by positioning relatively. And with easing plugin, we achieve some cool effect of bouncing when you hover out from the image.  You can put any html inside the info_container DIV elements as long as it doesn’t go beyond the borders. Look at the stylesheet and you’ll find it very gramatical. You can customize the sizes by modifying the div classes.

Download the Source

Inspiration : http://dibusoft.com/portfolio

2 Responses to "How to make a beautiful portfolio gallery using jQuery Animate !"

1 | Mike

April 21st, 2009 at 3:01 pm

Avatar

This is great; I saw your link at the build internet blog and will give this script a shot as well as theirs. Nice job.

2 | claudio

June 15th, 2009 at 11:05 am

Avatar

Also found your link over at build internet blog. Will use one of those for sure on my new portfolio page. Congrats and thank you!

Comment Form


Translator

Tags