Permalink
Browse files

fix examples

  • Loading branch information...
1 parent 765e6b2 commit 0f3d94dcd6ed187730bc26618bb6cff34b40d8e3 @sorenbs sorenbs committed May 9, 2012
@@ -64,7 +64,6 @@
});
var text = Crafty.e("SpriteText").text("Crafty Roxx");
-​</script>
-
+</script>
</body>
</html>
View
@@ -1,6 +1,6 @@
---
layout: cookbook
-title: What we need
+title: Crafty Cookbook
---
Welcome to the Crafty Cookbook - a collection of code snippets and ideas for solving common problems.
@@ -82,6 +82,14 @@ Crafty.e("RightPoints, DOM, 2D, Text")
And the result
-<iframe width="600" height="300" src="/tutorial/games/pong/pong.html">
+<iframe id="gameframe" width="600" height="300" src="/tutorial/games/pong/pong.html">
This is an iframe. sorry.
</iframe>
+
+<script type="text/javascript">
+ //Prevent the game from scrolling main page
+ if (frames['gameframe']!=undefined)
+ frames['gameframe'].focus(); // Works in all browser, except Firefox
+ else
+ document.getElementById('gameframe').focus(); // Works in Firefox
+</script>

0 comments on commit 0f3d94d

Please sign in to comment.