function init() {

  //touch events
  canvas.addEventListener('touchstart',dragStartTouch);
  canvas.addEventListener('touchend',dragStopTouch);
  canvas.addEventListener('touchmove',dragTouch);
  //mouse events
  canvas.addEventListener('mousedown',dragStartMouse);
  canvas.addEventListener('mouseup',dragStopMouse);
  canvas.addEventListener('mouseleave',dragStopMouse);
  canvas.addEventListener('mousemove',dragMouse);
  //set slider
  setSlider(attribute.width);
}
//adding the function to their respective events
adding the function to their respective events
adding the function to their respective events
function init() {
  canvas.addEventListener('touchstart',dragStartTouch);
  canvas.addEventListener('touchend',dragStopTouch);
  canvas.addEventListener('touchmove',dragTouch);
  canvas.addEventListener('mousedown',dragStartMouse);
  canvas.addEventListener('mouseup',dragStopMouse);
  canvas.addEventListener('mouseleave',dragStopMouse);
  canvas.addEventListener('mousemove',dragMouse);
  setSlider(attribute.width);
}
function init ( ) { canvas . addEventListener ( 'touchstart' , dragStartTouch ) ; canvas . addEventListener ( 'touchend' , dragStopTouch ) ; canvas . addEventListener ( 'touchmove' , dragTouch ) ; canvas . addEventListener ( 'mousedown' , dragStartMouse ) ; canvas . addEventListener ( 'mouseup' , dragStopMouse ) ; canvas . addEventListener ( 'mouseleave' , dragStopMouse ) ; canvas . addEventListener ( 'mousemove' , dragMouse ) ; setSlider ( attribute . width ) ; }
adding the function to their respective events
adding the function to their respective events
//touch events //mouse events //set slider