title: FabricJS - Scrolling canvas using the same scroll as the window
body: <p>I'm creating an app that take a screenshot of the the body by using Html2canvas library. After taking the screenshot I show it in a canvas component by using fabricJS framework. This canvas will have the same height and width of the body. My issue is that I need to scroll through the canvas as if I were in the page. I've been trying with some code like this <a href="http://jsfiddle.net/Kienz/f3u5r/" rel="nofollow noreferrer">http://jsfiddle.net/Kienz/f3u5r/</a> but it actually adds a scroll to the div that contains my canvas, but I need to use the same div as the window, otherwise I will have two scroll bars.</p>
  
  <p>This is the code of my canvas</p>
  
  <pre><code>&lt;div style="height: 100%; width: 100%" id="canvasContainer"&gt;
      &lt;canvas id="fbcanvas" style="height: 100%; width: 100%"; position:relative;&gt;&lt;/canvas&gt;
  &lt;/div&gt;
  
  
  #canvasContainer {
  display: none;
  z-index: 1000000;
  overflow: auto;
  }
  </code></pre>
  
  <p>Thanks</p>
  
  <p>Edit:</p>
  
  <p>This is how it looks now,</p>
  
  <p><a href="https://i.stack.imgur.com/5lUAe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5lUAe.png" alt="enter image description here"></a></p>
  
  <p>So when I scroll with the canvas scroll I scroll through the canvas. When I scroll with the window's canvas I scroll through the page. I need to use the scroll from the window but for scrolling through the canvas, not the window.</p>