]> iEval git - gruntmaster-page.git/blob - js/10-modal.js
30da26750d149e2fcb210fcab835605cb53c4861
[gruntmaster-page.git] / js / 10-modal.js
1 ;(function(){
2 'use strict';
3
4 function show_modal () {
5 $('.modal').removeClass('hidden');
6 setTimeout(function (){
7 $('body').addClass('modal-open');
8 }, 20);
9 }
10
11 function hide_modal () {
12 $('body').removeClass('modal-open');
13 $('.modal').one('transitionend', function (){
14 $('.modal').addClass('hidden');
15 });
16 }
17
18 $( document ).ready(function() {
19 $('.backdrop,.modal').detach().appendTo('body');
20 $('#solution').on('click', function (e){
21 show_modal();
22 e.preventDefault();
23 });
24 $('.backdrop').on('click', hide_modal);
25 window.onkeyup = function (event) {
26 if (event.keyCode === 27)
27 hide_modal();
28 }
29 });
30 })();
This page took 0.040897 seconds and 3 git commands to generate.