简体   繁体   English

如何更改滚动条的颜色

[英]How can I change the color of scroll bar

I have Task to change the color of scroll bar.For that I used the jscrollpane.By doing this only the browser scroll is changed.I want to change the color of the dropdown list also.How can I do this? 我有任务来改变滚动条的颜色。为此,我使用了jscrollpane.By这样做只有浏览器滚动被更改。我想更改下拉列表的颜色。我怎么能这样做? html is HTML是

  <div class='columnLeft'>
       <div class="labels w110">
            <label>Country</label>
       </div>
       <div class="controls hello" id="hello">
            @Html.DropDownList("ddlReCountry", null, new { @onchange = "onReBindCountry()", @class = "dropdown w325" })
       </div>
  </div>

javascript is javascript是

 $(function () {
            $('.hello ').jScrollPane();
            $('#hello').bind(
            'jsp-scroll-y',
        function (event, scrollPositionY, isAtTop, isAtBottom) {
            console.log('#pane1 Handle jsp-scroll-y', this,
                        'scrollPositionY=', scrollPositionY,
                        'isAtTop=', isAtTop,
                        'isAtBottom=', isAtBottom);
        });
 });

css is css是

.jspTrack {
    background: lightgray !important;
}

.jspDrag {
    background: gray !important;
}

I am not really sure if you can. 我不确定你是否可以。 but you can build your own dropdown list using textbox,button and div that will be opened after clicking the button. 但您可以使用单击按钮后打开的文本框,按钮和div来构建自己的下拉列表。 In this way you can customize every thing in the dropdown even the content of the drop down, you can search on the net there is a plenty samples of such approch you can use one of them 通过这种方式你可以自定义下拉列表中的每一个东西,甚至下拉的内容,你可以在网上搜索有大量样本这样的approch你可以使用其中一个

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM