-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
78 lines (66 loc) · 1.81 KB
/
script.js
File metadata and controls
78 lines (66 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
//this only affects the div we want it to affect - instead of all divs simultaniously.
$(document).ready(function() {
$('.buttons').mouseenter(function() {
$(this).toggleClass('cool');
});
});
$(document).ready(function() {
$('.wtf').click(function(){
$(this).fadeOut('3');
});
});
$(document).ready(function() {
$('.cool').mouseenter(function(){
$(this).fadeTo('fast', 100);
});
});
$(document).ready(function() {
$(".pull-me").click(function() {
$(".panel").slideToggle("slow");
});
});
// To -do list
$(document).ready(myClick);
function myAdd(){
var toAdd = $('input[name=checkListItem]').val();
$('.list').append('<div class="item">' + toAdd + '</div>');
}
function myClick(){
$('#button').click(myAdd);
$(document).on('click', '.item', myRemove);
}
function myRemove(){
$(this).remove();
}
//aletrnative to do list function
$(document).ready(function() {
$('button').click(function() {
var toAdd = $("input[name=message]").val();
$('#messages').append("<p>"+toAdd+"</p>");
});
});
//super mario code - to move left right up and down.
$(document).ready(function() {
$(document).keydown(function(key) {
switch(parseInt(key.which,10)) {
case 65:
$('img').animate({left: "-=10px"}, 'fast');
break;
case 83:
$('img').animate({top: "+=10px"}, 'fast');
break;
case 87:
$('img').animate({top: "-=10px"}, 'fast');
break;
case 68:
$('img').animate({left: "+=10px"}, 'fast');
break;
default:
break;
}
});
});
// draggable car - click and move around
$(document).ready(function(){
$("#car").draggable();
});