嗨,当我开始滚动时,如何将徽标从左上角移动到中心。谢谢
Hi, how can I move the logo from the top left corner to the center when I start scrolling. Thanks
我想知道如何在开始滚动时将徽标从左上角移到中间。谢谢!
- 在要滚动的 html 元素上有一个 onscroll 事件;
- 内部 onscroll 事件处理将徽标元素的样式更改为 align:center;
类似下面的内容(伪代码):
<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>
我想知道如何在开始滚动时将徽标从左上角移到中间。谢谢!
- 在要滚动的 html 元素上有一个 onscroll 事件;
- 内部 onscroll 事件处理将徽标元素的样式更改为 align:center;
类似下面的内容(伪代码):
<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>