Last active
August 29, 2015 14:04
-
-
Save MicFin/7fa8608d343623d76142 to your computer and use it in GitHub Desktop.
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
$(function() { | |
$('#thumbs a').on('click', function(e) { | |
e.preventDefault(); | |
$('#thumbs img').css('border', 'none'); | |
$(this).find('img').css('border', 'solid 2px black'); | |
var newSrc = $(this).find('img').attr('src'); | |
$('#fullsize img').attr('src', newSrc); | |
var newCaption = $(this).find('img').data('caption'); | |
$('#fullsize p').text(newCaption); | |
$('#modal, #modalBg').fadeIn(); | |
}); | |
$('#modalBg').on('click', function(){ | |
$('#modal, #modalBg').fadeOut(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment