Skip to content

Instantly share code, notes, and snippets.

@tmaslen
Created August 17, 2009 09:57
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 tmaslen/169029 to your computer and use it in GitHub Desktop.
Save tmaslen/169029 to your computer and use it in GitHub Desktop.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-GB" lang="en-GB">
<head profile="http://dublincore.org/documents/dcq-html/">
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<link rel="schema.dcterms" href="http://purl.org/dc/terms/" />
<meta name="DCTERMS.created" content="2006-09-15T12:00:00Z" />
<meta name="DCTERMS.modified" content="2006-09-15T12:35:00Z" />
<!--[if IE]><![if gte IE 6]><![endif]-->
<script src="http://www.bbc.co.uk/glow/1.5.1/core/core.js" type="text/javascript"></script>
<script src="http://www.bbc.co.uk/glow/1.5.1/widgets/widgets.js" type="text/javascript"></script>
<link href="http://www.bbc.co.uk/glow/1.5.1/widgets/widgets.css" type="text/css" rel="stylesheet" />
<script type="text/javascript">
glow.ready(function(){
glow.events.addListener('#title1', 'click', function() {
glow.dom.get('#content1').toggleClass('show');
});
glow.events.addListener('#title2', 'click', function() {
glow.dom.get('#content2').toggleClass('show');
});
});
</script>
<style type="text/css">
#content1,
#content2 {display: none;}
#content1.show,
#content2.show {display: block;}
</style>
<!--[if IE]><![endif]><![endif]-->
</head>
<body>
<h3>Show/Hide Div Example</h3>
<div>
<h4 id="title1"><img src="img/add.png" alt="Show Div" border="0" style="margin-right:6px; margin-top:3px; margin-bottom:-3px; cursor:pointer;" />Title #1</h4>
<div id="content1" style="margin-top:5px; border:1px solid red;">
<p> This is the content of the #1 div</p>
</div>
<h4 id="title2"><img src="img/add.png" alt="Show Div" border="0" style="margin-right:6px; margin-top:3px; margin-bottom:-3px; cursor:pointer;" />Title #2</h4>
<div id="content2" style="margin-top:5px; border:1px solid red;">
<p> This is the content of the #2 div</p>
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment