-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.html
124 lines (100 loc) · 1.96 KB
/
demo.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script>
window.onload=function ()
{
var x=0;
var oImg=document.getElementById('img1');
var aImg=document.getElementsByTagName('img');
var oLastImg=oImg;
var lastX=0;
var iSpeed=0;
var timer=null;
var i=0;
for(i=1;i<77;i++)
{
(function (oNewImg){
var oImg=new Image();
oImg.onload=function ()
{
oNewImg.src=this.src;
};
oImg.src='img/miaov ('+i+').jpg';
oNewImg.style.display='none';
document.body.appendChild(oNewImg);
})(document.createElement('img'));
}
document.onmousedown=function (ev)
{
var oEvent=ev||event;
var disX=oEvent.clientX-x;
clearInterval(timer);
document.onmousemove=function (ev)
{
var oEvent=ev||event;
x=oEvent.clientX-disX;
move();
iSpeed=x-lastX;
lastX=x;
//oImg.src='img/miaov ('+l+').jpg';
return false;
};
document.onmouseup=function ()
{
document.onmousemove=null;
document.onmouseup=null;
document.title=iSpeed;
timer=setInterval(function (){
x+=iSpeed;
move();
}, 30);
};
function move()
{
if(iSpeed>0)
{
iSpeed--;
}
else
{
iSpeed++;
}
if(iSpeed==0)
{
clearInterval(timer);
}
var l=parseInt(-x/10);
if(l>0)
{
l=l%77;
}
else
{
l=l+-Math.floor(l/77)*77;
}
document.title=iSpeed;
if(oLastImg!=aImg[l])
{
oLastImg.style.display='none';
aImg[l].style.display='block';
oLastImg=aImg[l];
}
}
return false;
};
};
</script>
</head>
<body>
<img id="img1" src="img/miaov (0).jpg" />
<!--<div id="bg"></div>
<div id="prog">
——360度全景展示 载入中......<span>0%</span>
<div id="bar"></div>
</div>-->
</body>
</html>