Screencast – How To Create An ‘Easy Gallery’ jQuery Plugin
By Drew Douglass |
February 13, 2010 |
5 Comments

OK then today we're going to take a look at creating a jQuery Plugin for a nice and easy, opacity filled, picture gallery. The aim of this fifteen minute video screencast/tutorial is to help you with basic plugin development and get you used to writing plugins from scratch. Continue Reading...
Video Tutorial:
Final Code
/**
* Easy Gallery jQuery Plugin
* Author: Drew Douglass
* Version: 0.1
*
*
*/
(function($){
$.fn.easyGallery = function(settings) {
//setup some options
var opts = $.extend({}, $.fn.easyGallery.defaults,settings);
return this.each(function(setting){
var options = $.extend({}, opts, $(this).data());
$(this).hover(function(){
$(this).siblings().stop().animate({
opacity: options.opacity
},options.duration);
}, function(){
$(this).siblings().stop().animate({
opacity: options.originalOpacity
},options.duration);
});
});
}
$.fn.easyGallery.defaults = {
duration: 500,
opacity: 0.5,
originalOpacity: 1
}
})(jQuery);
Helpful Resources
Thank to Jarel Remick for providing the free demo images.

This author has not yet added a biography. However no worries, it's coming soon. Just be patient!
5 Comments
Great tutorial! Very very nice…
For some reason this crashes IE8 big time..
good tutorial. thanks
[...] Drew Douglass – How To Create An ‘Easy Gallery’ jQuery Plugin [...]
Very good tutoial. Many thanks.