mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-07 15:07:13 +08:00
62 lines
1.8 KiB
HTML
62 lines
1.8 KiB
HTML
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Modals</title>
|
|
|
|
<!-- Sets initial viewport load and disables zooming -->
|
|
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
|
|
<link href="../dist/ionicons.css" rel="stylesheet">
|
|
<link href="../dist/ionic.css" rel="stylesheet">
|
|
</head>
|
|
<body>
|
|
|
|
<section>
|
|
|
|
<header class="bar bar-header bar-dark">
|
|
<h1 class="title">Modals</h1>
|
|
</header>
|
|
|
|
<main class="content padded has-header">
|
|
<a href="#" class="button button-warning" id="modal-opener">Open Modal</a>
|
|
<p><a class="button button-secondary" href="index.html">Homepage</a></p>
|
|
</main>
|
|
|
|
</section>
|
|
|
|
<div id="modal" class="modal slide-in-up">
|
|
<header class="bar bar-header bar-success">
|
|
<h1 class="title">BOOM</h1>
|
|
<a href="#" class="button" id="modal-closer">Close</a>
|
|
</header>
|
|
|
|
<main class="content padded has-header">
|
|
<h2>I'm a thing</h2>
|
|
<div style="background-color: red; width: 100%; height: 1000px"></div>
|
|
</main>
|
|
</div>
|
|
|
|
<script src="../dist/ionic.js"></script>
|
|
<script>
|
|
var open = document.getElementById('modal-opener');
|
|
var anim = ionic.Animator.animate(modal, function() {
|
|
console.log('Animation finished');
|
|
});
|
|
|
|
ionic.on('tap', function(e) {
|
|
var modal = document.getElementById('modal');
|
|
modal.classList.add('active');
|
|
anim.enter();
|
|
return false;
|
|
}, open);
|
|
|
|
var closer = document.getElementById('modal-closer');
|
|
ionic.on('tap', function(e) {
|
|
var modal = document.getElementById('modal');
|
|
modal.classList.remove('active');
|
|
anim.leave();
|
|
return false;
|
|
}, closer);
|
|
</script>
|
|
</body>
|
|
</html>
|