Wijmo 5 - Pseudo Classes
HTML
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdn.grapecity.com/wijmo/5.latest/styles/wijmo.min.css">
<script src="https://cdn.grapecity.com/wijmo/5.latest/controls/wijmo.min.js"></script>
<script src="https://cdn.grapecity.com/wijmo/5.latest/controls/wijmo.gauge.min.js"></script>
<div class="container">
<h1>Wijmo Pseudo Classes</h1>
<p>
This example shows how you can use Wijmo's pseudo-class
<b>wj-state-focused</b> to create CSS-based animations
applied when gauge controls get the focus.
</p>
<p>
Click the gauges to change the current value and watch how the gauge thumb
appearance changes.
</p>
<div id="theRadialGauge"></div>
<div id="theLinearGauge"></div>
</div>
CSS
.wj-gauge {
width: 300px;
margin: auto auto;
}
.wj-gauge .wj-face path {
fill: #d0d0d0;
stroke: none;
}
.wj-gauge .wj-pointer path {
fill: #404040;
stroke: none;
}
.wj-gauge circle.wj-pointer {
fill: #404040;
stroke: none;
transition: fill stroke .5s;
}
.wj-gauge.wj-state-focused circle.wj-pointer {
fill: red;
stroke: red;
stroke-width: 10px;
transition: fill stroke .5s;
}
JavaScript
onload = function() {
var theRadialGauge = new wijmo.gauge.RadialGauge('#theRadialGauge', {
min: 0,
max: 100,
value: 50,
thumbSize: 6,
isReadOnly: false,
face: { thickness: 0.08 },
pointer: { thickness: 0.08 },
valueChanged: valueChanged
});
var theLinearGauge = new wijmo.gauge.LinearGauge('#theLinearGauge', {
min: 0,
max: 100,
value: 50,
thumbSize: 10,
isReadOnly: false,
face: { thickness: 0.25 },
pointer: { thickness: 0.25 },
valueChanged: valueChanged
});
// synchronize gauges
function valueChanged(sender, args) {
theRadialGauge.value = theLinearGauge.value = sender.value;
}
}