Hi, how can I move the logo from the top left corner to the center when I start scrolling. Thanks
I want to know how to move the logo from the top left corner to the center when I start scrolling. Thanks!
- Have a onscroll event on the html element you want to scroll;
- Inside onscroll event handling change the style of logo element to align:center;
something like below(psuedo code):
<div onscroll="handleMyScrolling(event)"> <logo id="logo"></logo> </div> <script> function handleMyScrolling(event){ document.getElementById('logo').style= // your style to bring the element to center. } </script>