Skip to content

Instantly share code, notes, and snippets.

@stannehill
Created July 29, 2013 17:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stannehill/6106007 to your computer and use it in GitHub Desktop.
Save stannehill/6106007 to your computer and use it in GitHub Desktop.
First chunk of code for frontend of socket.io blog post.
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