Animated brands section
This commit is contained in:
1 parent
427f2f6f53
commit
e0113c1b61
5 files changed
+152
-10
No files matched your search
@@ -0,0 +1,15 @@
|
||||
const observer = new IntersectionObserver(entries => {
|
||||
entries.forEach(entry => {
|
||||
if (entry.isIntersecting) {
|
||||
if (entry.target.classList.contains('reverse'))
|
||||
entry.target.classList.add('table-item-animation-reverse');
|
||||
else
|
||||
entry.target.classList.add('table-item-animation');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
let targets = document.querySelectorAll('.table-item');
|
||||
targets.forEach(target => {
|
||||
observer.observe(target);
|
||||
})
|
||||
Reference in new issue
Block a user