Skip to content

Counter

NickWare edited this page Dec 27, 2021 · 1 revision

The Counter control HTML model:

<div class="Counter Rounded" data-countername="CV1">
    <div class="CountBack"></div>
    <label class="CountValue"><input type="text" value="0"></label>
    <div class="CountForward"></div>
</div>

<div class="Counter Rounded Editable" data-countername="CV2">
    <div class="CountBack"></div>
    <label class="CountValue"><input type="text" value="0"></label>
    <div class="CountForward"></div>
</div>

JS:

facefull.Counters["CV1"].getValue();

facefull.Counters["CV1"].setValue(10);

facefull.Counters["CV1"].onBeforeCount = function(direction) {
    if (direction > 0) {
        console.log("Count forward blocked");
        return false;
    }
    return true;
}

facefull.Counters["CV1"].onAfterCount = function(direction) {
    // event after setting a new value
}
Clone this wiki locally