dom-knob

Get the angle between the center of an element and a mouse/touch on drag.

Usage no npm install needed!

<script type="module">
  import domKnob from 'https://cdn.skypack.dev/dom-knob';
</script>

README

dom-knob

Get the angle between the center of an element and a mouse/touch on drag.

install

npm install knob

example

var knob = require('knob')

var elem = document.querySelector('#myKnob')
var callback = function(degrees) {
  console.log(degrees)
}

knob(elem, callback)