-
Notifications
You must be signed in to change notification settings - Fork 58
/
Copy pathjQueryRotateExample.html
92 lines (83 loc) · 2.75 KB
/
jQueryRotateExample.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
<html>
<head>
<style type="text/css">
#statuses {
border: 1px black solid;
background: #ddd;
color: green;
}
#statuses .error {
color: red;
}
</style>
<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js'></script>
<script type='text/javascript' src='jQueryRotate.js'></script>
<script type='text/javascript'>
function log(text, error) {
$("#statuses").get(0).appendChild(document.createElement("div")).innerHTML = text;
if (error) {
$("#statuses").get(0).lastChild.className = "error";
}
}
$(document).ready(function()
{
var rot=$('.image').rotate({
center: ["100%","100%"],
maxAngle:360,
minAngle:0,
angle:0,
animatedGif:false,
callback: function(){
log('Rotation for image 1 done')
}
})[0]
.rotate({
animateTo: 120,
callback: function(){
log(this.Wilq32.PhotoEffect._parameters.center[0]);
}
})
var rot=$('#test3').rotate({
angle: 15,
easing: $.easing.easeInOutExpo,
duration: 500,
bind:{
"mouseover":function(){ $(this).rotate({animateTo:85});},
"mouseout":function(){$(this).rotate({animateTo:-35});}
}});
var func = function(){
$("#test").rotate({angle:0, duration: 3000, animateTo:360, callback : func});
setTimeout(function(){
$("#test").stopRotate();
$("#test").rotate({animateTo: 40});
}, 1000);
}
func();
var angle = 0;
setInterval(function(){
angle+=3;
$("#test2").rotate(angle);
$("#test4").rotate({
angle: angle,
center: [300,300]
});
},50);
});
</script>
</head>
<body>
<div id="tst">
<img class="image" src='http://4.bp.blogspot.com/_9a9gJG-E2Ig/SAsb-ijoBJI/AAAAAAAAAAk/OM7W_4sBAgk/s320/agatka.jpg' style='width:150px'/>
<img id="test" src='http://4.bp.blogspot.com/_9a9gJG-E2Ig/SAsb-ijoBJI/AAAAAAAAAAk/OM7W_4sBAgk/s320/agatka.jpg' />
<img id="test2" src='http://4.bp.blogspot.com/_9a9gJG-E2Ig/SAsb-ijoBJI/AAAAAAAAAAk/OM7W_4sBAgk/s320/agatka.jpg' />
<img id="test3" src='http://4.bp.blogspot.com/_9a9gJG-E2Ig/SAsb-ijoBJI/AAAAAAAAAAk/OM7W_4sBAgk/s320/agatka.jpg' />
<p> text test lalalalla
<img id="test4" src='http://4.bp.blogspot.com/_9a9gJG-E2Ig/SAsb-ijoBJI/AAAAAAAAAAk/OM7W_4sBAgk/s320/agatka.jpg' />
test sttestests
</p>
</div>
<div id="statuses">
Log:
</div>
</body>
</html>