Skip to content

Instantly share code, notes, and snippets.

@jakearchibald
Created August 28, 2009 13:09
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 jakearchibald/176978 to your computer and use it in GitHub Desktop.
Save jakearchibald/176978 to your computer and use it in GitHub Desktop.
<div id="panel1">
<p>This is my first Panel</p>
</div>
<div id="panel2">
<p>This is my second Panel</p>
</div>
<p><a href="#" id="showFirstPanel">Show first panel</a></p>
<p><a href="#" id="showSecondPanel">Show second panel</a></p>
<script type="text/javascript">
gloader.load(["glow", "1", "glow.widgets.Panel", "glow.events"]);
</script>
<script type="text/javascript">
glow.ready(function() {
// create both panels
var panel1 = new glow.widgets.Panel('#panel1');
var panel2 = new glow.widgets.Panel('#panel2');
// add a listener to show the first panel when the relevant link is clicked
glow.events.addListener('#showFirstPanel', 'click', function() {
panel1.show();
})
// and same for the second
glow.events.addListener('#showSecondPanel', 'click', function() {
panel2.show();
})
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment