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>
25 lines
754 B
JavaScript
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);
|
|
}
|
|
});
|