qt5base-lts/doc/global/template/scripts/extras.js
Topi Reinio 2002103baa Doc: Update the online documentation template
This change fixes a number of issues in the online template:
    - Missing vertical line after the login icon in the header
    - Update header, footer links and appearance
    - Adjust alternate background color of table cells to improve
      readability
    - Fix style of cookie notification in the html header
    - Add The Qt Company logo in the footer
    - Adjust list item marker image
    - Improve responsiveness of footer

Change-Id: I77147b4b4161d6001c095a4b67e15552132100e6
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
2015-03-11 09:17:39 +00:00

25 lines
702 B
JavaScript

var vOffset = 65;
$(function () {
$('a[href*=#]:not([href=#])').on('click', function (e) {
if (e.which == 2)
return true;
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
if (target.length) {
setTimeout(function () {
$('html, body').animate({scrollTop: target.offset().top - vOffset}, 50);}, 50);
}
});
});
$(window).load(function () {
var h = window.location.hash;
var re = /[^a-z0-9_\#\-]/i
if (h.length > 1 && !re.test(h)) {
setTimeout(function () {
$(window).scrollTop($(h).offset().top - vOffset);
}, 0);
}
});