-
Notifications
You must be signed in to change notification settings - Fork 177
/
easing.html
59 lines (49 loc) · 1.19 KB
/
easing.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>jquery.pep - easing</title>
<!-- Load local jQuery. -->
<script src="../libs/jquery/jquery.js"></script>
<script src="../libs/modernizr.min.js"></script>
<!-- Load local lib and tests. -->
<script src="../src/jquery.pep.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('.pep').pep({
axis: 'x',
initiate: pdrag,
start: pdrag,
drag: pdrag,
stop: pdrag,
easing: pdrag,
rest: pdrag,
});
function pdrag(e, obj){
var drag = $(obj.el);
var left = String( drag.position().left)+"px";
$(".status").text(left);
$('.other').width(left);
}
});
</script>
<style type="text/css">
.pep{
background: blue;
height: 100px;
width: 100px;
cursor: move;
}
.other{
width:0%;
height: 40px;
background-color:green;
}
</style>
</head>
<body>
<div class="pep"></div>
<div class="other"></div>
<div class="status">status</div>
</body>
</html>