457496b830
An online documentation template that follows the style of qt.io site. Update the url variable for Qt modules to point to doc.qt.io/qt-5/. Task-number: QTBUG-42086 Change-Id: I5428a02cd503aef2217efd7361f4c8b7b5895a52 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
24 lines
679 B
JavaScript
24 lines
679 B
JavaScript
var vOffset = 65;
|
|
|
|
$(function () {
|
|
$('a[href*=#]:not([href=#])').on('click', function () {
|
|
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);
|
|
// return false;
|
|
}
|
|
});
|
|
});
|
|
|
|
$(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);
|
|
}
|
|
});
|