gpt4 book ai didi

css - 在 extjs 中显示图像而不是复选框的选中状态

转载 作者:行者123 更新时间:2023-11-28 09:28:24 25 4
gpt4 key购买 nike

如何在用户选中时显示图像(勾选图像)而不是复选框的默认勾选?

我尝试使用 checkedCls 配置,其中图像出现在复选框的背面。

checkedCls: 'checkedBoxStyle'

 .checkedBoxStyle{
background-image:url('http://www.chathamhouse.org/sites/default/files/public/images/buttons/tick-icon.png');
background-repeat:no-repeat;
}

jsfiddle开始。

最佳答案

好吧,图像只改变了它的背景位置

.x-form-cb-checked {
background-position: 0 -13px;
}

因为原始图像看起来像这样:

enter image description here

你应该在这里改变整个图像。

我建议更改基类并强制覆盖

像这样:

.newBase input{
background-image:url('../resources/images/checkBox_Tick_Mark.png') !Important;
}

在配置中

...
baseCls: 'newBase',
...

查看您的 JSFiddle (图片路径不对,不过应该能给你指路)

关于css - 在 extjs 中显示图像而不是复选框的选中状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14889918/

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