Created
July 29, 2013 17:30
-
-
Save stannehill/6106007 to your computer and use it in GitHub Desktop.
First chunk of code for frontend of socket.io blog post.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var socket = io.connect('http://localhost:4000'); | |
socket.on('connect', function () { | |
socket.on('return', function (data) { | |
$('#target').animate({top: '500', opacity: 1}, 3000); | |
}); | |
socket.on('player', function(data){ | |
if(data.player !== 0){ | |
$('#target').css({"top": '-220px',"opacity": "0.1"}); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment