滚动条样式修改兼容各个浏览器


参考网站:https://nicescroll.areaaperta.com/demo/

参考案例:https://github.com/inuyaksa/jquery.nicescroll

修改之后样式:

 

所做步骤:

<div id="boxscroll4">
  <div class="wrapper"></div>
</div>
 
写入css
<style type="text/css">
  #boxscroll4 {
    height: 300px;
    margin-top: 40px;
    background-color: #00FF66;
    font-family: Georgia, "Times New Roman", Times, serif;
    font-size: 18px;
    padding: 20px;
    overflow-y: scroll;
  }
  .wrapper{
    height: 600px;
    background: red;
  }
</style>
引入js
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script src="js/jquery.nicescroll.min.js"></script>

<script>
  $(document).ready(function() {
    $("#boxscroll4").niceScroll("#boxscroll4 .wrapper",{cursorborder:"",cursorcolor:"green",boxzoom:true});  // hw acceleration enabled when using wrapper
  });
</script>


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM