mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 18:17:13 +02:00
Fix anchor scroll
This commit is contained in:
24
docs/_templates/footer.html
vendored
24
docs/_templates/footer.html
vendored
@ -27,5 +27,29 @@
|
|||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
<script>
|
||||||
|
(function() {
|
||||||
|
var runMyCode = function($) {
|
||||||
|
$(window).ready(function() {
|
||||||
|
if ($('#pionav').css('display') !== 'block') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
window.setTimeout('$(window).scrollTop($(window).scrollTop() - 50);', 50);
|
||||||
|
$(window).on('hashchange', function(e){
|
||||||
|
$(window).scrollTop($(window).scrollTop() - 50);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
var timer = function() {
|
||||||
|
if (window.jQuery) {
|
||||||
|
runMyCode(window.jQuery);
|
||||||
|
} else {
|
||||||
|
window.setTimeout(timer, 50);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
timer();
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
{{ super() }}
|
{{ super() }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
Reference in New Issue
Block a user