Set highlight style to the active anchor
This commit is contained in:
@@ -114,4 +114,22 @@ $(function () {
|
|||||||
});
|
});
|
||||||
stabilityToggle.prop('checked', search === '?stableonly=true');
|
stabilityToggle.prop('checked', search === '?stableonly=true');
|
||||||
unstable.toggleClass('hidden', stabilityToggle[0].checked);
|
unstable.toggleClass('hidden', stabilityToggle[0].checked);
|
||||||
|
|
||||||
|
|
||||||
|
// Highlighting current anchor
|
||||||
|
|
||||||
|
var anchors = $('.anchor');
|
||||||
|
var _onHashChange = function () {
|
||||||
|
var activeHash = window.document.location.hash
|
||||||
|
.replace(/\./g, '\\.'); // Escape dot in element id
|
||||||
|
|
||||||
|
anchors.removeClass('highlighted');
|
||||||
|
|
||||||
|
if (activeHash.length > 0) {
|
||||||
|
anchors.filter(activeHash).addClass('highlighted');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
$(window).on('hashchange', _onHashChange);
|
||||||
|
_onHashChange();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -51,6 +51,9 @@ body {
|
|||||||
width: 0px;
|
width: 0px;
|
||||||
height: 0px;
|
height: 0px;
|
||||||
}
|
}
|
||||||
|
.nameContainer .anchor.highlighted + h4 {
|
||||||
|
background-color: #faebcc;
|
||||||
|
}
|
||||||
a {
|
a {
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user