Skip to content

Instantly share code, notes, and snippets.

@yarosla
Created September 13, 2013 17:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yarosla/6553342 to your computer and use it in GitHub Desktop.
Save yarosla/6553342 to your computer and use it in GitHub Desktop.
body {padding:20px;}
<!DOCTYPE html>
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>Foundation 4 Bin</title>
<link href="http://cdnjs.cloudflare.com/ajax/libs/foundation/4.3.1/css/normalize.min.css" rel="stylesheet" type="text/css" />
<link href="http://cdnjs.cloudflare.com/ajax/libs/foundation/4.3.1/css/foundation.min.css" rel="stylesheet" type="text/css" />
<script src="http://cdnjs.cloudflare.com/ajax/libs/foundation/4.3.1/js/vendor/custom.modernizr.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/foundation/4.3.1/js/vendor/jquery.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/foundation/4.3.1/js/foundation.min.js"></script>
</head>
<body>
<p>foundation.reveal.js bug. Wrong background switching when opening new modal before animation completes.</p>
<p>Modal background remains shown.</p>
<div id="myModal" class="reveal-modal">
<h2>Awesome. I have it.</h2>
<p class="lead">Your couch. It is mine.</p>
<p>Im a cool paragraph that lives inside of an even cooler modal. Wins</p>
<a class="close-reveal-modal">&#215;</a>
</div>
</body>
</html>
$(function(){
$(document).foundation(); // initialize foundation
$('#myModal').foundation('reveal', 'open'); // open modal
setTimeout(function(){
// close it after 1 second
$('#myModal').foundation('reveal', 'close');
}, 1000);
setTimeout(function(){
// open again before animation completes
// (default animation duration is 250 ms)
$('#myModal').foundation('reveal', 'open');
}, 1200);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment