niceScroll滚动条使用
有时候我们可能觉得系统默认的滚动条太丑,想要改变它,虽然可以通过css来改变,但是火狐直接不支持css改变滚动条,所以我们用js来解决
niceScroll官网:https://nicescroll.areaaperta.com/
jQuery官网:https://jquery.com/
niceScroll插件基于jQuery,所以先引入jQuery
基本配置
$("[user-basic-message]").niceScroll({
touchbehavior: false,
cursorcolor: "#000",
cursoropacitymax: 1,
cursorwidth: 5,
cursorborder: "none",
cursorborderradius: "4px",
background: "",
autohidemode: false
});
效果图