Skip to content

Commit

Permalink
Merge pull request #19 from Spone/patch-2
Browse files Browse the repository at this point in the history
Update Markup.md
  • Loading branch information
darsain committed Nov 11, 2014
2 parents e582afa + 6c0cec5 commit 0be1ceb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/Markup.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ var panning = new Motio(element, {
fps: 30, // Frames per second. More fps = higher CPU load.
speedX: -30 // Negative horizontal speed = panning to left.
});
sprite.play(); // start animation
panning.play(); // start animation

// Sprite
var element = document.querySelector('#sprite');
Expand Down Expand Up @@ -65,4 +65,4 @@ To have a correctly working sprite based animation, you need an element that is

This means that the element width & height (specifically the element's border box size) has to equal the width & height of one animation frame. The element size is set by you in CSS. You can set padding, margin, and border, Motio will still work, as long as the border-box size equals the size of one frame. The only thing that'll break it is changing the `background-origin`. So don't touch that :)

Also, calling spriote based Motio on hidden elements just doesn't work, as Motio cannot retrieve their size. In this case, use [`width`](Options.md#width) & [`height`](Options.md#height) options to set the width and height of the element manually.
Also, calling spriote based Motio on hidden elements just doesn't work, as Motio cannot retrieve their size. In this case, use [`width`](Options.md#width) & [`height`](Options.md#height) options to set the width and height of the element manually.

0 comments on commit 0be1ceb

Please sign in to comment.