Created
May 1, 2014 02:36
-
-
Save sartaj/1e61d3c2b40eda052a59 to your computer and use it in GitHub Desktop.
image-gallery.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.filter-button').on('click', function(e) { | |
var button = $(this).attr('id'); | |
if ( $(this).hasClass('active')) { | |
hideTheseImages(button); | |
} else { | |
showTheseImages(button); | |
} | |
}); | |
function hideTheseImages(imageClass) { | |
$('.' + imageClass).fadeOut(); | |
$('#' + imageClass).removeClass('active'); | |
alertify.success(imageClass +" has been removed."); | |
} | |
function showTheseImages(imageClass) { | |
$('.' + imageClass).fadeIn(); | |
$('#' + imageClass).addClass('active'); | |
alertify.success(imageClass +" has been added."); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment