Skip to content

Commit f96c689

Browse files
committedJan 5, 2022
fix more js
1 parent 418056a commit f96c689

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎app/javascript/main-wp.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ document.addEventListener("DOMContentLoaded", function () {
3939
// get clicked on letter
4040
let letter = link.getAttribute('href');
4141
// find letter section in the overall list and how far it is down
42-
let offsetInList = document.querySelector('.list-alphabet .title-main.'+ letter).offset().top;
43-
let offsetOfList = document.querySelector('.list-alphabet').offset().top;
44-
let sectionHeaderHeight = $('.list-alphabet .title-main.'+ letter).height();
42+
let offsetInList = document.querySelector('.list-alphabet .title-main.'+ letter).offsetTop;
43+
let offsetOfList = document.querySelector('.list-alphabet').offsetTop;
44+
let sectionHeaderHeight = document.querySelector('.list-alphabet .title-main.'+ letter).getBoundingClientRect().height;
4545
let scrollTo = offsetOfList - (-1 * offsetInList) - sectionHeaderHeight;
4646

4747
document.querySelector('.list-alphabet')

0 commit comments

Comments
 (0)
Please sign in to comment.