jQuery UI的按钮改变颜色 [英] Changing color of jQuery UI Buttons

查看:1195
本文介绍了jQuery UI的按钮改变颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种简单的方法来改变一个jQuery UI按钮的颜色?修改CSS是从文档气馁,这样做无论如何是棘手的。他们说,我们建议使用ThemeRoller工具来创建和下载,很容易建立和维护自定义主题。我知道如何更改主题,但随后你如何让在同一页上不同颜色的按钮?

Is there an easy way to change the color of a jQuery UI Button? Modifying the css is discouraged from the documentation and doing so anyway is tricky. They say, "We recommend using the ThemeRoller tool to create and download custom themes that are easy to build and maintain." I understand how to change the theme, but then how do you get different colored buttons on the same page?

推荐答案

我只是做了这一点:创建新的颜色按钮,一个新的主题;复制..hard ..和..soft ......在新的主题图像文件夹文件的梯度;重命名这些,以便不与主旋律混淆他们;最后的样式添加到按钮。这迎合梯度和颜色...

I just did this: create a new theme with the new colour button; copy the ..hard.. and ..soft... gradient files from the new theme images folder; rename them so as to not confuse them with the main theme; and finally add the style to the button. This caters for the gradient and the colour...

我只是尝试这样做的一个绿色按钮:

I just tried this for a green button:

a.green-button
{
    background: url(Images/GreenBGHardGrad.png) repeat-x center;
    border: 1px solid #132b14;
    color:#FFFFFF;
}
a.green-button:hover
{ 
    background: url(Images/GreenBGSoftGrad.png) repeat-x center;
    border: 1px solid #132b14;
    color:#FFFFFF;
}
a.green-button:active
{
    background-color:#FFFFFF;
    border: 1px solid #132b14;
    color:#132b14;
}

这篇关于jQuery UI的按钮改变颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆