How to implement snap scrolling with custom scroll

问题: I am using custom scroll bar for my html page (scrollbar plugin). when i used snap scroll css with scroll bar plugin its working fine but it destroyed the smoothness of the...

问题:

I am using custom scroll bar for my html page (scrollbar plugin). when i used snap scroll css with scroll bar plugin its working fine but it destroyed the smoothness of the scroll bar. like when i scroll down then it stop for a moment and suddenly scroll down to next container.

here is the snap scroll css

.container {
  scroll-snap-type: mandatory;
  scroll-snap-points-y: repeat(300px);
  scroll-snap-type: y mandatory;
}

.child {
  scroll-snap-align: start;
}

I have also tried to use the Iscroll plugin but its not working for me.

Can anybody provide me any jquery/JavaScript solution or any custom scroll bar who have snap scrolling functionality?


回答1:

use this :

 scroll-snap-type: y proximity
  • 发表于 2019-03-05 17:06
  • 阅读 ( 155 )
  • 分类:sof

条评论

请先 登录 后评论
不写代码的码农
小编

篇文章

作家榜 »

  1. 小编 文章
返回顶部
部分文章转自于网络,若有侵权请联系我们删除