Q:

Javascript animation speed

I have stolen the code below to try to work out how I can build something similar. However I do not see where I can adjust the speed of the animation. I.e. this code is for an image moving from left to right, however it is moving too slowly.
<canvas id="canvas" width=1200 height=300></canvas>

<script>
window.requestAnimFrame = (function(){
return  window.requestAnimationFrame       ||
    window.webkitRequestAnimationFrame ||
    window.mozRequestAnimationFrame    ||
    window.oRequestAnimationFrame      ||
    window.msRequestAnimationFrame     ||
    function( callback ){
        window.setTimeout(callback, 1000 / 120);
    };
})();

var canvas = document.getElementById("canvas"),
cx = canvas.getContext("2d");

function Card(x,y){
this.x = x || -300;
this.y = y || 0;
this.img=new Image();

this.init=function(){

    // this makes myCard available in the img.onload function
    // otherwise "this" inside img.onload refers to the img
    var self=this;

    this.img.onload = function() 
    {
        self.draw();
        loop();
    }
    this.img.src = "f15ourbase.png";  
}

this.draw = function(){
    cx.drawImage(this.img, this.x, this.y);
}

}

var myCard = new Card(50,50);
myCard.init();

function loop(){

if(myCard.x<canvas.width-0){
    requestAnimFrame(loop);
}

cx.clearRect(0, 0, canvas.width, canvas.height);

myCard.x++;

myCard.draw();

}
</script>

A:

Change your window.setTimeout(callback, 1000 / 120); back to window.setTimeout(callback, 1000 / 60);
And instead of doing:
myCard.x++;

You move it by 5 pixels for example:
// this increases 5 pixels
myCard.x = myCard.x + 5;

In HTML you are also missing apostrophes for canvas width and height element:
<canvas id="canvas" width="1200" height="300"></canvas>

Edit:
Some mysterious way I got down voted without comments(?) and because I hate it I ended up making a new code which attempts to fix most if not all problems I could find in the code author provided - added code comments for all the relevant parts.
// Animation frame gist
window.requestAnimFrame = (function() {
return  window.requestAnimationFrame   ||
    window.webkitRequestAnimationFrame ||
    window.mozRequestAnimationFrame    ||
    window.oRequestAnimationFrame      ||
    window.msRequestAnimationFrame     ||
    function( callback ){
        window.setTimeout(callback, 1000 / 60);
    };
})();

// Variable declarations
var canvas = document.getElementById("canvas"),
    cx = canvas.getContext("2d"),
    myCard;

/**
 * Card declaration
 *  
 */
var Card = function(x, y) {

    // Values after || is values what orginal post author wanted to use
    this.x = x || -300;
    this.y = y || 0;
    this.img = undefined;
    // Image to be used for this card
    this.imgSrc = "f15ourbase.png";

};

/**
 * Initialize
 *
 */
Card.prototype.init = function(callback) {

   // self refers to this card
   var self = this;

   this.img = new Image();

   // onload success callback
   this.img.onload = function() {

       // triggering callback on successfull load
       return callback();

   };

   // onload failure callback
   this.img.onerror = function() {
       // Returning error message for the caller of this method
       return callback("Loading image failed!");
   };

   // Triggering image loading
   this.img.src = this.imgSrc;

};

/**
 * Draw this on canvas
 *
 */
Card.prototype.draw = function() {

    // cx (context) could be also passed, now it is global
    cx.drawImage(this.img, this.x, this.y);

};

/**
 * Main loop
 *
 */
function loop() {

    // Clear canvas
    cx.clearRect(0, 0, canvas.width, canvas.height);

    // If card is still within visible area, we continue loop
    if(myCard.x < canvas.width) {

        // Draw card
        myCard.draw();

        // Move card by 5 pixels
        myCard.x = myCard.x + 5;

        // Schedule next loop 
        // "return" makes sure that we are not executing lines below this
        return requestAnimFrame(loop);  

    }

    // Just for debugging, diplayed when animation done
    console.log("Animation finished");    

};

// Main program starts - Creating a new card instance
myCard = new Card(50, 50);

// Initializing card
myCard.init(function(err) {

    // if error with loading the image of the card, we notify
    if(err) {
        return alert(err);
    }

    // no errors, we can do the main loop
    loop();

});

Check out Updated JsFiddle example
To further explore possibilities of HTML5 canvas I recommend reading tutorials from html5canvastutorials

