Created
November 27, 2013 04:22
-
-
Save glebcha/7670625 to your computer and use it in GitHub Desktop.
Simple full-size preview popup.
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
var thumbModal = function (thumbs, fullImgContainer) { | |
for (var i = 0; i < thumbs.length; i++) { | |
var thumb = thumbs[i]; | |
var show = function (event) { | |
event.preventDefault(); | |
var imgBlock = this.querySelector(fullImgContainer); | |
if (imgBlock.style.display != 'block') { | |
$(fullImgContainer).hide(); | |
$(imgBlock).fadeIn(500); | |
} else { | |
$(imgBlock).fadeOut(500); | |
} | |
}; | |
$(thumb).bind('click', show); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment