我正在使用jquery nicescroll(http://areaaperta.com/nicescroll/)。
我想通过添加cursorminheight参数来调整光标的高度,这似乎很直接。这不起作用。
HTML
<div class="viewport-scrollbox">
<div class="wrapper-content-scrollbox">
<ul class="client-gallery">
<li><img src="image1.jpg" alt="" /></li>
<li><img src="image2.jpg" alt="" /></li>
<li><img src="image3.jpg" alt="" /></li>
</ul>
</div><!--close wrapper-content-scrollbox-->
</div><!--close viewport-scrollbox-->
CSS
.viewport-scrollbox{
height:500px;
overflow:auto;
margin-bottom:20px;
margin-right:auto;
margin-left:auto;
}
JS
<script src="js/jquery.nicescroll.min.js"></script>
<script type="text/javascript">
$(document).ready(
function() {
$("html").niceScroll({cursorwidth:10}); /* main scrollbar on page*/
$(".viewport-scrollbox").niceScroll(".wrapper-content-scrollbox",{touchbehavior:false,cursorcolor:"#898989",cursoropacitymax:0.7,cursorwidth:6,background:"#ccc",autohidemode:false});/*customize scrollbar for gallery*/
$("#ascrail2001").css({'top': '14px','right':'22px'});/*position scrollbar for gallery*/
}
);
</script>
我尝试过这两个 NOT 工作的选项:
$(".viewport-scrollbox").niceScroll(".wrapper-content-scrollbox",{touchbehavior:false,cursorcolor:"#898989",cursoropacitymax:0.7,cursorwidth:6,background:"#ccc",autohidemode:false,cursorminheight:50});
和
$("div#ascrail2001.nicescroll-rails div").css('height','50px');
感谢您的帮助!
答案 0 :(得分:2)
您可以使用精美滚动的内置功能。如下图所示。
$(yourElement).niceScroll({
cursorfixedheight: 70
});
希望这会有所帮助!!