Topi Reinio d238f7e019 Doc: Update online documentation template
This change brings the online template up to date with recent
changes:
    - Update links in header and footer.
    - To improve page load time and reduce load on qt.io,
      do not load images from the main site.
    - Fix auto-scroll/highlight jQuery to work on anchors
      containing full stop ('.') characters
    - Responsiveness: Fix menu issues with narrow views
    - Fix styling of subscript/superscript HTML tags
    - Make script URIs protocol-agnostic

Change-Id: I219e8ce6ff2e70f9374ad5e037ceda8f710a6a10
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2015-04-14 08:32:46 +00:00

25 lines
754 B
JavaScript

var vOffset = 65;
$(function () {
$('a[href*=#]:not([href=#])').on('click', function (e) {
if (e.which == 2)
return true;
var target = $(this.hash.replace(/(\.)/g, "\\$1"));
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.replace(/(\.)/g, "\\$1")).offset().top - vOffset);
}, 0);
}
});