Last active
August 29, 2015 14:27
-
-
Save wakim/e317171ff80e7945a63e to your computer and use it in GitHub Desktop.
Simple Refill Modal
This file contains hidden or 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(){ | |
| $(".modal-inner").on("click", function(e) { | |
| e.stopPropagation(); | |
| }); | |
| $(".modal-fade-screen, .modal-close, .modal").on("click", function() { | |
| var thisModalId = this.getAttribute("for"); | |
| Modal.close(thisModalId); | |
| }); | |
| }); | |
| window.Modal = {}; | |
| window.Modal.close = function(modalId) { | |
| $("body").removeClass("modal-open"); | |
| $("#" + modalId).prop("checked", false).change(); | |
| } | |
| window.Modal.open = function(modalStateId) { | |
| var $modalState = $("#" + modalStateId); | |
| $("body").addClass("modal-open"); | |
| $modalState.prop("checked", true).change(); | |
| $("body").addClass("modal-open"); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment