title: Change the position of an image on mousemove
body: <p>I want to change the position of the image when mouse move but the image doesn't change even if position is changed when I did <code>console.log</code></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var image = document.getElementById('img')
  
  image.addEventListener('mousemove', function(e) {
    console.log(e.pageX * -1 / 12)
    var valueX = (e.pageX * -1 / 12);
    var valueY = (e.pageY * -1 / 12);
    image.style.backgroundPositionX = valueX + "px"
    image.style.backgroundPositionY = valueY + "px"
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;header&gt;
  
    &lt;img id="img" src="https://placehold.it/100x100" alt=""&gt;
  
  &lt;/header&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <pre><code>header {
      height: 100vh;
      width: 100%;
      position: absolute;
      overflow: hidden;
  }
  
  header img {
      width: 100%;
      height: 100%;
      position: absolute;
  }
  </code></pre>