forked from joaopereirawd/animatedModal.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support for navigation to next/previous modals joaopereirawd#63
also I add support to close modal with Escape key joaopereirawd#60
- Loading branch information
Martin Gonzalez Robles
committed
Sep 6, 2018
1 parent
50f7a03
commit cfbe5ae
Showing
3 changed files
with
177 additions
and
117 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,84 +1,119 @@ | ||
<!doctype html> | ||
<html class="no-js" lang=""> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | ||
<title>DEMOS</title> | ||
<link rel="stylesheet" href="css/normalize.min.css"> | ||
<link rel="stylesheet" href="css/animate.min.css"> | ||
<style> | ||
#btn-close-modal { | ||
width:100%; | ||
text-align: center; | ||
cursor:pointer; | ||
color:#fff; | ||
} | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | ||
<title>DEMOS</title> | ||
<link rel="stylesheet" href="css/normalize.min.css"> | ||
<link rel="stylesheet" href="css/animate.min.css"> | ||
<style> | ||
.btn-modal{ | ||
width:100%; | ||
text-align: center; | ||
cursor:pointer; | ||
color:#fff; | ||
} | ||
|
||
</style> | ||
</head> | ||
<body> | ||
|
||
</style> | ||
</head> | ||
<body> | ||
<!--Call your modal--> | ||
<ul> | ||
<li><a id="demo01" href="#animatedModal">DEMO01</a></li> | ||
<li><a id="demo02" href="#modal-02">DEMO02</a></li> | ||
<li><a id="demo03" href="#modal-03">DEMO03</a></li> | ||
</ul> | ||
|
||
<!--Call your modal--> | ||
<ul> | ||
<li><a id="demo01" href="#animatedModal">DEMO01</a></li> | ||
<li><a id="demo02" href="#modal-02">DEMO02</a></li> | ||
</ul> | ||
|
||
|
||
<!--DEMO01--> | ||
<div id="animatedModal"> | ||
<!--THIS IS IMPORTANT! to close the modal, the class name has to match the name given on the ID --> | ||
<div id="btn-close-modal" class="close-animatedModal"> | ||
CLOSE MODAL | ||
</div> | ||
|
||
<div class="modal-content"> | ||
<!--Your modal content goes here--> | ||
</div> | ||
<!--DEMO01--> | ||
<div id="animatedModal"> | ||
<!--THIS IS IMPORTANT! to close the modal, the class name has to match the name given on the ID --> | ||
<div class="close-animatedModal btn-modal btn-close-modal"> | ||
CLOSE MODAL | ||
</div> | ||
<!--THIS IS IMPORTANT! to navigate to the next modal, the class name has to match the name given on the ID --> | ||
<div class="next-animatedModal btn-modal btn-next-modal"> | ||
NEXT MODAL | ||
</div> | ||
<div class="modal-content"> | ||
<!--Your modal content goes here--> | ||
</div> | ||
</div> | ||
|
||
<!--DEMO02--> | ||
<div id="modal-02"> | ||
<!--"THIS IS IMPORTANT! to close the modal, the class name has to match the name given on the ID--> | ||
<div id="btn-close-modal" class="close-modal-02"> | ||
CLOSE MODAL | ||
</div> | ||
|
||
<div class="modal-content"> | ||
<!--Your modal content goes here--> | ||
</div> | ||
<!--DEMO02--> | ||
<div id="modal-02"> | ||
<!--"THIS IS IMPORTANT! to close the modal, the class name has to match the name given on the ID--> | ||
<div class="close-modal-02 btn-modal btn-close-modal"> | ||
CLOSE MODAL | ||
</div> | ||
<!--THIS IS IMPORTANT! to navigate to the previous modal, the class name has to match the name given on the ID --> | ||
<div class="previous-modal-02 btn-modal btn-previous-modal"> | ||
PREVIOUS MODAL | ||
</div> | ||
<!--THIS IS IMPORTANT! to navigate to the next modal, the class name has to match the name given on the ID --> | ||
<div class="next-modal-02 btn-modal btn-next-modal"> | ||
NEXT MODAL | ||
</div> | ||
<div class="modal-content"> | ||
<!--Your modal content goes here--> | ||
</div> | ||
</div> | ||
|
||
<!--DEMO03--> | ||
<div id="modal-03"> | ||
<!--"THIS IS IMPORTANT! to close the modal, the class name has to match the name given on the ID--> | ||
<div class="close-modal-03 btn-modal btn-close-modal"> | ||
CLOSE MODAL | ||
</div> | ||
<!--THIS IS IMPORTANT! to navigate to the previous modal, the class name has to match the name given on the ID --> | ||
<div class="previous-modal-03 btn-modal btn-previous-modal"> | ||
PREVIOUS MODAL | ||
</div> | ||
<div class="modal-content"> | ||
<!--Your modal content goes here--> | ||
</div> | ||
</div> | ||
|
||
<script src="js/jquery.min.js"></script> | ||
<script src="js/animatedModal.min.js"></script> | ||
<script> | ||
<script src="js/jquery.min.js"></script> | ||
<script src="js/animatedModal.min.js"></script> | ||
<script> | ||
//demo 01 | ||
$("#demo01").animatedModal({ | ||
next: '#demo02', | ||
}); | ||
|
||
//demo 01 | ||
$("#demo01").animatedModal(); | ||
//demo 02 | ||
$("#demo02").animatedModal({ | ||
modalTarget:'modal-02', | ||
animatedIn:'bounceInDown', | ||
animatedOut:'bounceOutDown', | ||
color:'#3498db', | ||
previous: '#demo01', | ||
next: '#demo03', | ||
// Callbacks | ||
beforeOpen: function() { | ||
console.log("The animation was called"); | ||
}, | ||
afterOpen: function() { | ||
console.log("The animation is completed"); | ||
}, | ||
beforeClose: function() { | ||
console.log("The animation was called"); | ||
}, | ||
afterClose: function() { | ||
console.log("The animation is completed"); | ||
} | ||
}); | ||
|
||
//demo 02 | ||
$("#demo02").animatedModal({ | ||
modalTarget:'modal-02', | ||
animatedIn:'lightSpeedIn', | ||
animatedOut:'bounceOutDown', | ||
color:'#3498db', | ||
// Callbacks | ||
beforeOpen: function() { | ||
console.log("The animation was called"); | ||
}, | ||
afterOpen: function() { | ||
console.log("The animation is completed"); | ||
}, | ||
beforeClose: function() { | ||
console.log("The animation was called"); | ||
}, | ||
afterClose: function() { | ||
console.log("The animation is completed"); | ||
} | ||
}); | ||
$("#demo03").animatedModal({ | ||
modalTarget:'modal-03', | ||
color:'#ff6a00', | ||
animatedIn:'bounceInDown', | ||
animatedOut:'bounceOutDown', | ||
previous: '#demo02', | ||
}); | ||
|
||
</script> | ||
</script> | ||
|
||
</body> | ||
</body> | ||
</html> |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.