Skip to content

Commit 5106929

Browse files
committed
References #11 - Updated hash logic by increasing timeout
1 parent db0a622 commit 5106929

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/javascripts/jquery.tocify.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,13 @@
117117
// Adds jQuery event handlers to the newly generated table of contents
118118
self._setEventHandlers();
119119

120-
// The window onload events allows enough time for the correct offset to be calculated
121-
window.addEventListener("load", function() {
120+
// The timeout makes sure the current element offset is correct
121+
setTimeout(function() {
122122

123123
// Sets the active TOC item
124124
self._setActiveElement();
125125

126-
}, false);
126+
}, 300);
127127

128128
},
129129

src/javascripts/jquery.tocify.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)