Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function($){
- $.fn.extend({
- modalPanel: function() {
- $(document).keydown(function(e) {
- switch(e.keyCode) {
- case 27: $("#modal-overlay").remove(); break;
- }
- });
- return this.each(function() {
- $(this).click(function(e) {
- e.preventDefault();
- var overlay = $("<div/>").click(function(e) {
- e.preventDefault();
- alert("overlay click");
- });
- $("body").append(overlay);
- overlay.fadeIn(200);
- });
- });
- }
- });
- })(jQuery);
Add Comment
Please, Sign In to add comment