Author: Takuya Aramaki (takaram)
Committer: GitHub (web-flow)
Pusher: saundefined
Date: 2024-11-29T13:28:14+03:00
Commit: Fix parameter link scrolling to the correct position (#1171) · php/web-php@98641f0 · GitHub
Raw diff: https://github.com/php/web-php/commit/98641f0bb9117c4c89fe5d214b6c8ddba5f37c9e.diff
Fix parameter link scrolling to the correct position (#1171)
Changed paths:
M js/common.js
Diff:
diff --git a/js/common.js b/js/common.js
index cea565982e..a81da820bb 100644
--- a/js/common.js
+++ b/js/common.js
@@ -368,7 +368,7 @@ $(document).ready(function () {
function findParameter(elt) {
var id = $(elt).text().replace(/^&?(\.\.\.)?\$?/g, '');
return $('.parameters, .options').find('.parameter').filter(function () {
- return $(elt).text().trim() === id; // PHP :: Bug #74493 :: Summary: On page links jump to incorrect anchors if the name contains the target
+ return $(this).text().trim() === id; // PHP :: Bug #74493 :: Summary: On page links jump to incorrect anchors if the name contains the target
}).first();
}
@@ -383,7 +383,7 @@ $(document).ready(function () {
var param = findParameter(this);
if (param.length) {
$.scrollTo({
- top: param.offset().top - 52,
+ top: param.offset().top,
left: 0
}, 400);
}