国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

javascript - js scroll bar implementation ideas
PHP中文網(wǎng)
PHP中文網(wǎng) 2017-06-12 09:32:11
0
4
937

The Vue2.0 scroll bar plug-in was not found. I wanted to use JS to implement the scroll bar. I found several JS plug-ins for scroll bar implementation on the Internet. I would like to ask if any master has written the scroll bar code manually? Or is there a related blog? No code is required, just a basic implementation idea is OK

PHP中文網(wǎng)
PHP中文網(wǎng)

認(rèn)證高級(jí)PHP講師

reply all(4)
過去多啦不再A夢(mèng)

First structure

<p class="wrapper">//包裹
  <p class="content">
    //內(nèi)容
 </p>
</p>

I won’t talk about css. We need to calculate the height of the scroll bar based on the height of the content, and then ensure the movement of the content element and scroll bar after the scroll event is triggered.
For compatibility, you need to consider mousewheel and touch events, that’s basically all.

漂亮男人

I wrote one a long time ago, you can just look at the link description

阿神

1. Do not use js to make floating object style position: fixed. But there is no floating effect.
2. Object js makes floating, object style absolute. Bind the scroll event to the object to determine the distance between the object's position and the top of the window. You can use scrollTop to move it. There are many such methods, you can look them up online

過去多啦不再A夢(mèng)

jc scroll bar plug-in

Written by myself, you can use it. If you have any questions, please contact us

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template