Skip to content

Instantly share code, notes, and snippets.

@wbashir
Created July 12, 2013 13:58
Show Gist options
  • Save wbashir/5984665 to your computer and use it in GitHub Desktop.
Save wbashir/5984665 to your computer and use it in GitHub Desktop.
Sidr open menu on body load
<html>
<head>
<!-- Your stuff -->
<!-- Include Sidr bundled CSS theme -->
<link rel="stylesheet" href="stylesheets/jquery.sidr.dark.css">
</head>
<body onload="init()">
<a id="simple-menu" href="#sidr">Toogle menu</a>
<div id="sidr">
<!-- Your content -->
<ul>
<li><a href="#">List 1</a></li>
<li class="active"><a href="#">List 2</a></li>
<li><a href="#">List 3</a></li>
</ul>
</div>
</body >
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
<script src="jquery.sidr.min.js"></script>
<script>
function init(){
$('#simple-menu').sidr();
$.sidr('open', 'sidr');
}
</script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment