-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjoel.html
101 lines (86 loc) · 2.38 KB
/
joel.html
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<style>
body {
margin: 0;
padding: 24px;
font:normal 12px/14px Arial, sans-serif;
background:gray;
}
#slot-window {
height:14px;
overflow:hidden;
position:relative;
border-style: solid;
}
#slot-wheel {
position: relative;
top:-14px;
text-align: center;
}
#slot-wheel SPAN {
background-color: white;
}
</style>
<script>
//$ is a function. whatever comes after it is in jQ library. $ is an object defined in jQ.
$(document).ready(function()
{
$('#slot-window').mouseenter(function()
{
var offset = Math.round(Math.random()*7)*14
console.log("hover on", offset)
var cssboom = {top: "-" + offset + "px"}
if (! window.animation_enter)
{
window.animation_enter = true;
$('#slot-wheel').animate(cssboom, "slow", "swing", function(){
window.animation_enter = false;
/*if (! window.animation_enter){
function showWidth(ele, w) {
$('#slot-wheel').text("The width for the " + ele +
" is " + w + "px.");
$('#slot-wheel').animate(function(){
showWidth("slot-wheel", $('#slot-wheel')
});
});
});
if (! window.animation_enter){
console.log("yourule")
function showWidth(ele, w) {
$('#slot-wheel').text("The width for the " + ele +
" is " + w + "px.");
$('#slot-wheel').animate(function(){
showWidth("slot-wheel", $('#slot-wheel')
});
});*/
});
}
});
if (! window.animation_leave)
$('#slot-window').mouseleave(function()
{
//window here is an object (not a function - no parens) and animation_leave is an attribute
window.animation_leave = true;
var reset = {top: "0" + "px"}
$('#slot-wheel').animate(reset, "slow")
window.animation_leave = false;
});
});
</script>
</head>
<body>
<div id="slot-window">
<div id="slot-wheel">
<div><span>I'm Feeling Doodley</span></div>
<div><span>I'm Feeling Artistic</span></div>
<div><span>I'm Feeling Hungry</span></div>
<div><span>I'm Feeling Puzzled</span></div>
<div><span>I'm Feeling Trendy</span></div>
<div><span>I'm Feeling Stellar</span></div>
<div><span>I'm Feeling Playful</span></div>
<div><span>I'm Feeling Wonderful</span></div></div>
</body>
</html>