title: Sync horizontal scrolling text with vertical when moving object
body: <p>I'm trying to make my text scroll from right to left with jQuery but with the vertical scroll bar, can you help me? When I try my code it works but it also makes the object move horizontally</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 $sun = $('.sun');
  var $win = $(window);
  
  $win.on('scroll', function() {
    var top = $win.scrollTop();
    $sun.css("transform", `translateX(${top}px)`);
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>body {
    width: 1277px;
    height: 148px;
    overflow-x: hidden;
  }
  
  container {
    width: 600px;
    height: 50px;
    overflow-x: hidden;
  }
  
  .sun {
    display: block;
    width: 600px;
    height: 50px;
    margin: 75vw 0vh;
    overflow-x: hidden;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="container"&gt;
    &lt;h1 class="sun"&gt;test&lt;/h1&gt;
  &lt;/div&gt;
  &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"&gt;&lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>