Last active
November 30, 2016 10:22
-
-
Save ZZR-china/587916632bf43f655e4ed34434b5dc7c to your computer and use it in GitHub Desktop.
jquery modal
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() { | |
$.fn.extend({ | |
modalShow:function () { | |
var btnVal = this.attr('data-val'); | |
var $wantModal = $('[val='+btnVal+']'); | |
this.bind('click', function(event) { | |
/* Act on the event */ | |
$wantModal.removeClass('hide'); | |
}); | |
$wantModal.find('.modal-close').bind('click', function(event) { | |
/* Act on the event */ | |
close(); | |
}); | |
function close () { | |
$wantModal.addClass('hide'); | |
} | |
return this; | |
}, | |
}); | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment