Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE HTML> 
<html lang="en">
    <head>
        
        <script> 
            function draw() {  
               
               var canvas = document.getElementById('canvas');
               var ctx = canvas.getContext('2d');
               document.getElementById('container').scrollLeft = 7800;
               
               // draw two identical squares at slighlty diff positions
               square(ctx, 8170);
               square(ctx, 8200);
               
            }
            
            function square(ctx, pos) {
               ctx.beginPath();
               ctx.moveTo(pos,0)
               ctx.lineTo(pos,18);
               ctx.lineTo(pos+10.5,18);
               ctx.lineTo(pos+10.5,0);
               ctx.lineTo(pos,0);               
               ctx.fill();
            }
            
        </script>
    </head>  
    
    <body onload="draw()">
        <div id="container" style="overflow:auto">
            <canvas id="canvas" width="17000" height="330"></canvas>  
        </div>
        
    </body>
    
</html>
 
if (document.getElementById('hello')) {
  document.getElementById('hello').innerHTML = 'Hello World - this was inserted using JavaScript';
}
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers