const options = {
root: null,
rootMargin: '0px',
threshold: 1.0
}
const svg = document.querySelector('svg')
const animation = document.getElementById('animate')
const observer = new IntersectionObserver((entries, observer) => {
entries.forEach((entry) => {
if (entry.isIntersecting) {
animation.beginElement()
svg.style.display = 'block'
}
})
}, options)
observer.observe(document.querySelector('#anim1'))
<animate id="animate" .../>
address
в p
.p
будет в p
div {
display: flex;
}
.container {
position: relative;
justify-content: space-between;
flex-direction: row;
width: 100%;
}
.center {
width: 100%;
justify-content: center;
position: absolute;
}
<div class="container">
<div>left</div>
<div class="center">
<div>
center block
</div>
</div>
<div>right</div>
</div>