iam*_*mCR 1 jquery jquery-plugins
这是我的jquery进度条我想改变进度条的颜色,类Acceptedbar为绿色,类Declinedbar为红色
<head runat="server">
<title>Idea Storm</title>
<link href="css/CSS.css" rel="stylesheet" type="text/css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js" type="text/javascript"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/jquery-ui.min.js"
type="text/javascript"></script>
<script src="script/ui.progressbar.js" type="text/javascript"></script>
?<style type="text/css">
.AcceptedBar > .ui-progressbar-value {
background:green;
}
.DeclinedBar > .ui-progressbar-value {
background: red;
}
</style>
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/smoothness/jquery-ui.css">
<%-- <link href="App_Themes/HRIS-Theme/jquery.ui.core.css" rel="stylesheet" type="text/css" />
<link href="App_Themes/HRIS-Theme/jquery.ui.theme.css" rel="stylesheet" type="text/css" />--%>
</head>
<script type="text/javascript">
$(function ()
{
$('.Accepted').each(function()
{
var valueFromHiddenField = $('input[type=hidden]', this).val();
$('.Acceptedbar', this).progressbar({ value: valueFromHiddenField});
});
});
$(function ()
{
$('.Declined').each(function() {
// We assume that there is only 1 hidden field under 'pbcontainer'
var valueFromHiddenField = $('input[type=hidden]', this).val();
$('.Declinedbar', this).progressbar({ value: valueFromHiddenField });
});
});
</script>
Run Code Online (Sandbox Code Playgroud)
您应该使用CSS来设置进度条的样式,这里有关于主题的详细信息:
.AcceptedBar > .ui-progressbar-value {
background: green;
}
.DeclinedBar > .ui-progressbar-value {
background: red;
}
Run Code Online (Sandbox Code Playgroud)
你不能使用background-color作为主题设置,background-image所以你必须使用background