gpt4 book ai didi

javascript - 如何更改滚动条的颜色

转载 作者:技术小花猫 更新时间:2023-10-29 11:42:42 24 4
gpt4 key购买 nike

我有任务来更改滚动条的颜色。为此,我使用了 jscrollpane。这样做只会更改浏览器滚动条。我也想更改下拉列表的颜色。我该怎么做?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 是

 $(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 是

.jspTrack {
background: lightgray !important;
}

.jspDrag {
background: gray !important;
}

最佳答案

我不确定你是否可以。但您可以使用文本框、按钮和 div 构建自己的下拉列表,单击按钮后将打开它们。通过这种方式,您可以自定义下拉列表中的所有内容,甚至下拉列表的内容,您可以在网上搜索有大量此类方法的示例,您可以使用其中之一

关于javascript - 如何更改滚动条的颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15918451/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com