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
//so before you had: | |
if(options.slide == 'up') { $(this).slideUp(time, options.callback);} // slide Up | |
else if(options.slide == 'down') { $(this).slideDown(time, options.callback);} // slide down | |
else if(options.slide == 'toggle') {$(this).slideToggle(time, options.callback);} // slide toggle | |
/**there's a pattern here | |
* if options.slide = up, call slideUp | |
* if it's down, call slideDown | |
* it it's toggle, call slideToggle |
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
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> | |
<script src="/socket.io/socket.io.js"></script> | |
<script> | |
$(document).ready(function() { | |
var socket = io.connect('http://localhost'); | |
$('#button').click(function(e){ | |
socket.emit('click'); | |
e.preventDefault(); |