obscured.html
6.03 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
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
* {
padding: 0;
margin: 0;
}
html,
body {
position: relative;
width: 100%;
height: 100%;
overflow: hidden;
}
#container {
display: flex;
justify-content: space-between;
align-items: center;
position: fixed;
left: 0;
top: 0;
width: 563px;
height: 333px;
padding: 20px 27px;
box-sizing: border-box;
background-color: #361a43;
border-radius: 5px;
overflow: hidden;
/* background-image: url(img/auction.svg);
background-size: 100% 100%; */
}
#container:hover {
border: #00cdcd 2px solid;
}
.auction{
width: 100%;
height: 100%;
}
/* #container .left {
margin-left: 14px;
}
.text .p1 {
font-size: 30px;
color: #E3FE03;
}
.text .p2 {
font-size: 40px;
color: #FFFFFF;
}
.text1 {
margin-top: 50px;
margin-bottom: 36px;
}
.tip {
font-size: 16px;
color: #B2B2BF;
}
#container .right {
width: 231px;
height: 293px;
background: url(img/auction.png);
} */
.wrap {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
</style>
</head>
<body id="body">
<iframe src="http://auction.autostreets.com/screen/27545" width="100%" height="100%" scrolling="no" id="website"
frameborder="0"></iframe>
<div class="wrap"></div>
<div id="container">
<img class="auction" src="img/auction.png" >
<!-- <div class="left">
<div class="text">
<div class="p1">竞拍信息</div>
<div class="p2">全透明</div>
</div>
<div class="text text1">
<div class="p1">竞拍信息</div>
<div class="p2">全透明</div>
</div>
<div class="tip">优·质·好·车 低·价·起·拍</div>
</div>
<div class="right"></div> -->
</div>
<script>
//需要调整尺寸的div
let c = document.getElementById('container')
// body监听移动事件
document.getElementById('body').addEventListener('mousemove', move)
// 鼠标按下事件
c.addEventListener('mousedown', down)
// 鼠标松开事件
document.getElementById('body').addEventListener('mouseup', up)
// 是否开启尺寸修改
let resizeable = false
// 鼠标按下时的坐标,并在修改尺寸时保存上一个鼠标的位置
let clientX, clientY
// div可修改的最小宽高
let minW = 8,
minH = 8
// 鼠标按下时的位置,使用n、s、w、e表示
let direc = ''
// 鼠标松开时结束尺寸修改
function up() {
resizeable = false
// document.body.removeEventListener('mousemove',move,false);
// document.body.removeEventListener('mouseup',up,false);
}
// 鼠标按下时开启尺寸修改
function down(e) {
let d = getDirection(e)
// 当位置为四个边和四个角时才开启尺寸修改
if (d !== '') {
resizeable = true
direc = d
clientX = e.clientX
clientY = e.clientY
}
}
// 鼠标移动事件
function move(e) {
let d = getDirection(e)
let cursor
// if (d === '') cursor = 'default';
if (d === '') cursor = 'move';
else cursor = d + '-resize';
// 修改鼠标显示效果
c.style.cursor = cursor;
// 当开启尺寸修改时,鼠标移动会修改div尺寸
if (resizeable) {
// 鼠标按下的位置在右边,修改宽度
if (direc.indexOf('e') !== -1) {
c.style.width = Math.max(minW, c.offsetWidth + (e.clientX - clientX)) + 'px'
clientX = e.clientX
}
// 鼠标按下的位置在上部,修改高度
if (direc.indexOf('n') !== -1) {
return
c.style.height = Math.max(minH, c.offsetHeight + (clientY - e.clientY)) + 'px'
clientY = e.clientY
}
// 鼠标按下的位置在底部,修改高度
if (direc.indexOf('s') !== -1) {
c.style.height = Math.max(minH, c.offsetHeight + (e.clientY - clientY)) + 'px'
clientY = e.clientY
}
// 鼠标按下的位置在左边,修改宽度
if (direc.indexOf('w') !== -1) {
return
c.style.width = Math.max(minW, c.offsetWidth + (clientX - e.clientX)) + 'px'
clientX = e.clientX
}
}
}
// 获取鼠标所在div的位置
function getDirection(ev) {
let xP, yP, offset, dir;
dir = '';
xP = ev.offsetX;
yP = ev.offsetY;
offset = 10;
if (yP < offset) dir += 'n';
else if (yP > c.offsetHeight - offset) dir += 's';
if (xP < offset) dir += 'w';
else if (xP > c.offsetWidth - offset) dir += 'e';
return dir;
}
// 拖拽
//定义元素初始位置
var eleP = {
left: 0,
top: 0
};
//定义鼠标初始位置
var startP = {
left: 0,
top: 0
};
c.onmousedown = function(event) {
if (resizeable) return
event = event || window.event;
//元素初始位置
eleP.left = c.offsetLeft;
eleP.top = c.offsetTop;
//鼠标初始位置
startP.left = event.clientX;
startP.top = event.clientY;
//c.onmousemove
document.onmousemove = function(event) {
event = event || window.event;
//鼠标最终位置
var endP = {
left: 0,
top: 0
};
endP.left = event.clientX;
endP.top = event.clientY;
//鼠标距离差
var disX = endP.left - startP.left;
var disY = endP.top - startP.top;
//确定元素位置
c.style.left = disX + eleP.left + 'px';
c.style.top = disY + eleP.top + 'px';
};
document.onmouseup = function() {
document.onmousemove = null;
document.onmouseup = null;
};
//禁止系统默认行为
return false;
};
//获取url参数
function getUrlParams(key){
var reg = new RegExp(key + '=([^&]*)');
var result = location.href.match(reg);
return result ?decodeURI(result[1]):null;
}
let id = getUrlParams('id')
id = id?id:27545
let websrc = 'http://auction.autostreets.com/screen/'+id
let website = document.getElementById('website')
website.setAttribute('src',websrc)
</script>
</body>
</html>