Skip to content

Commit

Permalink
Merge pull request #3723 from raspberrypi/develop
Browse files Browse the repository at this point in the history
Roll out latest internal changes to prod
  • Loading branch information
nathan-contino authored Jun 13, 2024
2 parents 94f9120 + 727a71f commit 196d2ab
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions jekyll-assets/_includes/scripts.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,16 @@

function scrollToElement(selector) {
try {
// if found, scroll to that id hash
console.log("Scrolling to ", selector);
var target = document.querySelector(selector);
if (target) {
var bbox = target.getBoundingClientRect();
var myid = target.getAttribute("id");
window.scrollTo({
top: bbox.top,
left: 0,
behavior: "smooth",
});
setTimeout(function () {
target.scrollIntoView({ behavior: "instant" });
setTimeout(function () {
target.scrollIntoView({ behavior: "instant" });
},100);
},1);


} else {
console.log("Target not found :(");
}
Expand Down

0 comments on commit 196d2ab

Please sign in to comment.