summaryrefslogtreecommitdiffstats
path: root/doc/global/template/scripts/extras.js
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@theqtcompany.com>2014-12-10 07:58:06 +0100
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2014-12-10 07:58:06 +0100
commit015002fec9abff6a4c1bb3fa4b9de87279a079c3 (patch)
treead93af535a503d0a49d6c6367e990a8fbca163d3 /doc/global/template/scripts/extras.js
parentf1e00262321cc8daa3c7506153653453e2779886 (diff)
parentb9547af45ea2bbbc634722c1ef41afdb54216ce2 (diff)
Merge remote-tracking branch 'origin/5.4' into dev
Conflicts: doc/global/template/style/online.css mkspecs/android-g++/qmake.conf Change-Id: Ib39ea7bd42f5ae12e82a3bc59a66787a16bdfc61
Diffstat (limited to 'doc/global/template/scripts/extras.js')
-rw-r--r--doc/global/template/scripts/extras.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/doc/global/template/scripts/extras.js b/doc/global/template/scripts/extras.js
new file mode 100644
index 0000000000..cb1102d493
--- /dev/null
+++ b/doc/global/template/scripts/extras.js
@@ -0,0 +1,23 @@
+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);
+ }
+});