Created
January 12, 2014 19:23
-
-
Save PunchRockgroin/8389188 to your computer and use it in GitHub Desktop.
Gumby close modal on click outside
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
$('.modal').on(Gumby.click, function(e){ | |
var container = $('.content'); | |
if((!container.is(e.target) // if the target of the click isn't the container... | |
&& container.has(e.target).length === 0)) // ... nor a descendant of the container | |
{ | |
$('.modal .close').trigger('gumby.trigger'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you for creating the script. I added it to the Magento + Gumby theme I am creating. I have credited you both in the .phtml file and in the humans.txt file.
http://dev.frontlinedev.com/