Created
August 28, 2009 13:09
-
-
Save jakearchibald/176978 to your computer and use it in GitHub Desktop.
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
<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