Skip to content

Instantly share code, notes, and snippets.

@bensternthal
Created April 24, 2013 00:14
Show Gist options
  • Save bensternthal/5448568 to your computer and use it in GitHub Desktop.
Save bensternthal/5448568 to your computer and use it in GitHub Desktop.
share on modal
// Close modal on clicking close button or background.
$document.on('click', '#modal .close', flicks.closeModal);
//$document.on('click', '#modal.bg_close', flicks.closeModal);
$(function() {
/* Share Widget *******/
var $share = $('.share');
var $popup = $share.find('.popup');
// Toggle the popup when the button is clicked.
// $share.find('.toggle').click(function(e) {
// e.preventDefault();
// $(this).siblings('.popup').fadeIn(200);
// });
$('body').on("click",'.share > .toggle', function(e) {
e.preventDefault();
$(this).siblings('.popup').fadeIn(200);
});
// Hide the popup when the mouse moves away.
$share.hover(null, function() {
$(this).find('.popup').fadeOut(200);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment