Skip to content

Commit

Permalink
Fixed formatting. Changed BallObject parameter to make it clear a JQu…
Browse files Browse the repository at this point in the history
…eryElement element is expected.
  • Loading branch information
alan-donnelly committed Oct 5, 2013
1 parent 38c9823 commit 78bf29f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
6 changes: 3 additions & 3 deletions JuggleBalls/Week2/BallObject.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function BallObject(ball) {
var ballDiv = ball;
function BallObject( JQueryElement ) {
var ballDiv = JQueryElement;
var curXpos = 0;
var curYpos = 0;

Expand All @@ -11,7 +11,7 @@ function BallObject(ball) {
ballDiv.css("left", curXpos+"px");
}

function moveVertical(pixels) {
function moveVertical( pixels ) {
curYpos = curYpos + pixels;
ballDiv.css("top",curYpos+"px");
}
Expand Down
30 changes: 16 additions & 14 deletions JuggleBalls/Week2/TurtleBall.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
<html>
<head>
<title>TurtleBall</title>
<link rel="stylesheet" type="text/css" href="style.css"/>
<script type="text/javascript" src="jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="TurtleBall.js"></script>
<script type="text/javascript" src="BallObject.js"></script>
</head>
<body>
<button id="btnUp">Up</button>
<button id="btnDown">Down</button>
<button id="btnLeft">Left</button>
<button id="btnRight">Right</button>
<div id="ballDiv"><img src="CoderDojo-ball.png" width='50px' height='50px'/></div>
</body>
<head>
<title>TurtleBall</title>
<link rel="stylesheet" type="text/css" href="style.css"/>
<script type="text/javascript" src="jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="TurtleBall.js"></script>
<script type="text/javascript" src="BallObject.js"></script>
</head>
<body>
<button id="btnUp">Up</button>
<button id="btnDown">Down</button>
<button id="btnLeft">Left</button>
<button id="btnRight">Right</button>
<div id="ballDiv">
<img src="CoderDojo-ball.png" width="50px" height="50px"/>
</div>
</body>
</html>

0 comments on commit 78bf29f

Please sign in to comment.