Last active
September 12, 2018 10:00
-
-
Save onokumus/224181ad4627b709cdc0 to your computer and use it in GitHub Desktop.
MetisMenu Hash
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Home</title> | |
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.2/css/bootstrap.min.css"> | |
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/metisMenu/1.1.3/metisMenu.min.css"> | |
</head> | |
<body> | |
<div class="container"> | |
<div class="row"> | |
<aside class="col-xs-12 col-sm-5 col-md-3 bg-info"> | |
<ul class="nav" id="menu"> | |
<li><a href="index.html">Home</a></li> | |
<li> | |
<a href="#">Page Nav</a> | |
<ul> | |
<li><a href="page.html">Page</a></li> | |
<li><a href="page.html#hash1">Page#hash1</a></li> | |
<li><a href="page.html#hash2">Page#hash2</a></li> | |
</ul> | |
</li> | |
</ul> | |
</aside> | |
<div class="col-xs-12 col-sm-7 col-md-3">CONTENT</div> | |
</div> | |
</div> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.2/js/bootstrap.min.js"></script> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/metisMenu/1.1.3/metisMenu.min.js"></script> | |
<script> | |
$(function () { | |
$("#menu").metisMenu(); | |
}); | |
</script> | |
</body> | |
</html> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Page</title> | |
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.2/css/bootstrap.min.css"> | |
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/metisMenu/1.1.3/metisMenu.min.css"> | |
</head> | |
<body> | |
<div class="container"> | |
<div class="row"> | |
<aside class="col-xs-12 col-sm-5 col-md-3 bg-info"> | |
<ul class="nav" id="menu"> | |
<li><a href="index.html">Home</a></li> | |
<li id="hash1"> | |
<a href="#">Page Nav 1</a> | |
<ul> | |
<li><a href="page.html">Page 1</a></li> | |
<li><a href="page.html#hash">Page 1 #hash</a></li> | |
</ul> | |
</li> | |
<li id="hash2"> | |
<a href="#">Page Nav 2 </a> | |
<ul> | |
<li><a href="page.html">Page 2 </a></li> | |
<li><a href="page.html#hash">Page 2 #hash</a></li> | |
</ul> | |
</li> | |
</ul> | |
</aside> | |
<div class="col-xs-12 col-sm-7 col-md-3">CONTENT</div> | |
</div> | |
</div> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.2/js/bootstrap.min.js"></script> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/metisMenu/1.1.3/metisMenu.min.js"></script> | |
<script> | |
$(function () { | |
var $hash = location.hash; | |
console.log($hash); | |
if (!!$hash) { | |
$($hash).addClass('active'); | |
} | |
$("#menu").metisMenu(); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment