Add LHB Engineering case study with reusable header/footer partials and scrollable hero screenshots
This commit is contained in:
13
js/screenshot-scroll-hint.js
Normal file
13
js/screenshot-scroll-hint.js
Normal file
@@ -0,0 +1,13 @@
|
||||
document.querySelectorAll('.screenshot-hero-scroll').forEach(function (el) {
|
||||
var img = el.querySelector('img');
|
||||
function check() {
|
||||
if (el.scrollHeight <= el.clientHeight) {
|
||||
el.classList.add('screenshot-hero-scroll--no-hint');
|
||||
}
|
||||
}
|
||||
if (img && !img.complete) {
|
||||
img.addEventListener('load', check);
|
||||
} else {
|
||||
check();
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user