-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathironman.html
More file actions
62 lines (59 loc) · 1.22 KB
/
ironman.html
File metadata and controls
62 lines (59 loc) · 1.22 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
<html>
<head>
<script src="jquery.js"></script>
<script>
var arc=function($arc,centerx,centery,dist,angle1){
var originx=centerx-$arc.position().left;
var originy=centery-$arc.position().top;
var angle=angle1;
var that={
dist:function(dist)
{
var distcos=Math.cos(angle)*dist;
var distsin=Math.sin(angle)*dist;
$arc.css({left:centerx+distcos+"px",top:centery-distsin-$arc.height()/2+"px"});
},
rotate:function(angle1) {
angle=angle1;
$arc.css({
'-webkit-transform-origin': originx+'px '+originy+'px',
WebkitTransform: 'rotate(' + angle + 'deg)'
});
$arc.css({
'-moz-transform': 'rotate(' + angle + 'deg)'
});
// timer = setTimeout(function () {
// rotate(angle+200);
// }, 1);
}
};
that.dist(dist);
that.rotate(angle1);
return that;
//rotate(45);
};
$(function () {
var $elie = $(".part");
var arc1=arc($elie,600,200,0,10);
// rotate(0);
});
</script>
</head>
<style>
.circle {
width: 357px;
height: 357px;
}
#part1
{
position:absolute;
height:300px;
width:300px;
background-image: url(arc.png);
background-size: 100% 100%;
}
</style>
<body>
<div class="part " id="part1"/>
</body>
</html>