git @ Cat's Eye Technologies DAM / master demo / range.html
master

Tree @master (Download .tar.gz)

range.html @masterraw · history · blame

<!DOCTYPE html>
<!--
SPDX-FileCopyrightText: In 2019, Chris Pressey, the original author of this work, placed it into the public domain.
For more information, please refer to <https://unlicense.org/>
SPDX-License-Identifier: Unlicense
-->
<head>
  <meta charset="utf-8">
  <title>DAM range demo</title>
</head>
<body>

<h1>DAM range demo</h1>

<p>DAM comes with a range widget.  This widget provides a slider, a textbox, and two buttons,
any of which can be used to adjust a numeric value within a range.</p>

<div id="installation"></div>

<script src="../dist/dam-plus-widgets-0.2.js"></script>
<script>
  var div=DAM.maker("div"),button=DAM.maker("button");
  var range = DAM.makeRange({
    title: "Fudge factor",
    min: 0,
    max: 100,
    value: 50,
    onchange: function(v) {
      console.log(v);
    }
  })
  document.getElementById('installation').appendChild(
    div(
      div(range),
      div(
        button(
          "Programatically set value to 33",
          { onclick: function() { range.setValue(33); } }
        )
      )
    )
  );
</script>

</body>