我在应用程序中使用了nicescroll。我吃过像这样的菜
$("#Total").niceScroll({
cursorwidth: '8px',
cursorborder: 'none',
cursorborderradius:'0px',
cursorcolor:"#39CCDB"
});但是我不想给出上面的样式。我想使用我已经实现的class.For来应用它们,如下所示
.scroll {
cursorwidth: '8px',
cursorborder: 'none',
cursorborderradius:'0px',
cursorcolor:"#39CCDB"
}和
var scrollbar = $("#Total").niceScroll({});
scrollbar.addClass("scroll");但是不起作用,请告诉我如何将样式应用于nicescroll的类。
发布于 2015-10-05 17:45:15
当遇到这类问题时,您可以在检查器中打印整个对象,然后查看可以使用的内容(使用console.log(nice))。所以这是我的解决方案
var div = niceScroll({ ... });
var nice = div.getNiceScroll();
$(nice)[0].rail.addClass('class-for-vertical');
$(nice)[0].rail.addClass('class-for-horizontal');发布于 2014-02-20 17:42:20
你不能那样做,但你可以试试
var options = {
cursorwidth: '8px',
cursorborder: 'none',
cursorborderradius:'0px',
cursorcolor:"#39CCDB"
};
$("#Total").niceScroll(options);发布于 2014-02-20 17:48:04
您可以使用:
$("#Total").niceScroll({cursorcolor:"#39CCDB",cursorwidth:"8px",cursorborderradius:"0px",cursorborder: "none"});https://stackoverflow.com/questions/21903718
复制相似问题