gpt4 book ai didi

jquery - 如何修复对话框按钮的单个 css 样式?

转载 作者:太空宇宙 更新时间:2023-11-04 13:38:42 25 4
gpt4 key购买 nike

我尝试在我的 jsp 中设置我的对话框按钮的样式,我使用以下代码,但是我有两个按钮的样式,我想为每个按钮设置单独的样式,

我正在使用 jquery 版本 ui 1.9

fiddle

j查询代码:

$('#success').dialog({
autoOpen: true,
height: 180,
width: 350,
modal: true,
resizable: false,
dialogClass: 'no-close',
buttons: {
"Add": function() {
$(this).dialog("close");
$( this ).dialog( "close" );
},
Cancel: function() {
$( this ).dialog( "close" );
}
}
});

最佳答案

我想我明白你在追求什么。尝试为对话框中的按钮设置样式吗?

您可以使用 nth-child() 选择来完成此操作。

http://jsfiddle.net/qP8DY/939/

CSS

.no-close .ui-dialog-buttonset .ui-button:nth-child(1) .ui-button-text 
{
background: red;
/*Other Styles */
}

.no-close .ui-dialog-buttonset .ui-button:nth-child(2) .ui-button-text
{
background: blue;
/*Other Styles */
}

关于jquery - 如何修复对话框按钮的单个 css 样式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22847216/

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