bootstrap-drawer
Version:
A Bootstrap add-on to create drawer (off-canvas) styled navigation
23 lines (17 loc) • 613 B
JavaScript
(function($, hljs) {
var page = window.location.pathname.split("/").pop();
hljs.initHighlightingOnLoad();
$('#doc-nav li').each(function() {
var href = $(this).find('a').attr('href');
if((page === href) || (page.length <= 0 && href === 'index.html')) {
$(this).addClass('active');
}
});
$('#doc-nav a').click(function() {
var href = $(this).attr('href');
if((page === href) || (page.length <= 0 && href === 'index.html')) {
$('#docDrawer').drawer('hide');
return false;
}
});
})(jQuery || {}, hljs);