Skip to content

Instantly share code, notes, and snippets.

@battlejj
Created April 22, 2012 01:13
Show Gist options
  • Save battlejj/2440658 to your computer and use it in GitHub Desktop.
Save battlejj/2440658 to your computer and use it in GitHub Desktop.
Simple jQuery Plugin for Popping Hidden Content Sample Code
<html>
<body>
<div id="main">
<a id="showlink" href="?">Pop the hidden stuff</a>
</div>
<div id="hiding" style="display:none;">
<h2>You can't see us...unless you pop us up!</h2>
<p>This is a bunch of hidden stuff. <a href="?" id="closelink">Close it!</a></p>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script src="jquery.popup.js"></script>
<script>
$(function(){
$('#showlink').click(function(e){ e.preventDefault(); $('#hiding').popup(); });
$('#closelink').click(function(e){ e.preventDefault(); $('#hiding').popup('close'); });
})
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment