如何在dojotoolkit中创建div粘贴? 有些滚动功能?
答案 0 :(得分:0)
你确实可以为scroll事件创建一个事件处理程序并连续重新定位div,或者你只需使用CSS并将position: fixed
添加到div。
例如:
body {
min-height: 9000px;
}
.box {
position: fixed;
width: 100px;
height: 100px;
left: calc(50% - 50px);
top: calc(50% - 50px);
background: yellow;
}

<div class="box">Even when you scroll this box stays centered</div>
&#13;