我在我的项目中使用jQuery按钮,我需要显示橙色的主按钮和灰色的辅助按钮;但对我来说,这两个按钮的颜色都是灰色的。我使用下面的代码:jQuery按钮主要和次要
$(function() {
$("button, input:submit").button({ icons: {primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'} });
});
我在我的项目中使用jQuery按钮,我需要显示橙色的主按钮和灰色的辅助按钮;但对我来说,这两个按钮的颜色都是灰色的。我使用下面的代码:jQuery按钮主要和次要
$(function() {
$("button, input:submit").button({ icons: {primary:'ui-icon-gear',secondary:'ui-icon-triangle-1-s'} });
});
“主”和“次要”的论点是将多个图标上相同的按钮。
要以不同方式设计不同的按钮,您需要分别拨打button()
。类似于:
$('#main_button').button({icons: {primary:'ui-icon-gear'} });
$('#other_button').button({icons: {primary:'other-icon'} });
编辑:我没有看到你如何使用button()调用设置背景颜色。也许尝试是这样的:
#other_button { background-color: orange;}
#other_button:hover { background-color: darker-orange;}
它更改我的按钮图标,但我需要更改我的按钮背景颜色 – Elankeeran 2010-10-23 20:59:02
我的主要需要更改为橙色和辅助按钮背景颜色需要更改为灰色 – Elankeeran 2010-10-23 21:02:17
难道你不会使用css? – JasonWoof 2010-10-23 21:03:24
我能够去要去theme roller,自定义按钮,以正确的背景色,然后下载定制包获得的辅助按钮样式。将背景添加到项目中,并将自定义CSS样式添加到按钮。
.custom-button
{
background: #f47d20 url(../content/images/ui-bg_glass_75_f47d20_1x400.png) 50% 50% repeat-x !important;
}
你在哪里定义按钮的颜色? – 2010-10-23 20:44:54