Lines 75-91
function togglePanel(node) {
Link Here
|
75 |
} |
75 |
} |
76 |
} |
76 |
} |
77 |
|
77 |
|
78 |
$(document).ready(function () { |
78 |
function apply_sticky(nodes) { |
79 |
//check if sticky element is stuck, if so add floating class |
79 |
if (nodes) { |
80 |
if ($(".sticky").length) { |
|
|
81 |
const observer = new IntersectionObserver( |
80 |
const observer = new IntersectionObserver( |
82 |
([e]) => |
81 |
([e]) => |
83 |
e.target.classList.toggle("floating", e.intersectionRatio < 1), |
82 |
e.target.classList.toggle("floating", e.intersectionRatio < 1), |
84 |
{ threshold: [1] } |
83 |
{ threshold: [1] } |
85 |
); |
84 |
); |
86 |
|
85 |
|
87 |
observer.observe(document.querySelector(".sticky")); |
86 |
observer.observe(nodes); |
88 |
} |
87 |
} |
|
|
88 |
} |
89 |
|
90 |
$(document).ready(function () { |
91 |
//check if sticky element is stuck, if so add floating class |
92 |
apply_sticky(document.querySelector(".sticky")); |
89 |
|
93 |
|
90 |
//check for a hash before setting focus |
94 |
//check for a hash before setting focus |
91 |
let hash = window.location.hash; |
95 |
let hash = window.location.hash; |