-
Notifications
You must be signed in to change notification settings - Fork 0
/
f.html
147 lines (133 loc) · 5.41 KB
/
f.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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Mobile Frame</title>
<script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js" crossorigin="anonymous"></script>
<style>
* {
padding: 0;
margin: 0;
font-size: 12px;
line-height: 100%;
}
body {
background-color: #333;
}
input {
border: none;
border-bottom: solid 1px #000;
background-color: #ccc;
height: 15px;
}
button {
border: none;
border-bottom: solid 1px #000;
background-color: #ccc;
height: 16px;
}
</style>
<script>
//force http
var cu = window.location.protocol;
if (cu == 'https:')
window.location =
document.location.href.toString().replace('https:', 'http:') + "?t" + (new Date()).valueOf() + "=1";
$(function () {
$(".ac-ma").click(function () {
setTimeout(function () {
var url = $(".ac-url").val();
var obj = $("<div>");
var pTop = 45;
var pLeft = $(window).width() - (window.fwidth + 20);
obj
.css({
"position": "absolute",
"width": window.fwidth,
"height": window.fheight,
"top": pTop,
"left": pLeft
})
.append(
$('<button>').css("width", 25).text('X').click(function () {
$("iframe", $(this).parent())
.attr("src", "about:close")
.remove();
$(this).parent().remove()
})
)
.append(
$('<a>').css("color", "#fff").text(url).dblclick(function () {
var u = prompt("url", $(this).text());
$(this).parent().find("iframe").attr('src', u);
})
)
.append(
$('<iframe>').css({
"width": window.fwidth,
"height": window.fheight
}).attr("frameborder", 0).attr('src', url)
)
;
obj.bind("mousedown", function (event) {
/* 获取需要拖动节点的坐标 */
var offset_x = $(this)[0].offsetLeft;//x坐标
var offset_y = $(this)[0].offsetTop;//y坐标
/* 获取当前鼠标的坐标 */
var mouse_x = event.pageX;
var mouse_y = event.pageY;
/* 绑定拖动事件 */
/* 由于拖动时,可能鼠标会移出元素,所以应该使用全局(document)元素 */
$(document).bind("mousemove", function (ev) {
/* 计算鼠标移动了的位置 */
var _x = ev.pageX - mouse_x;
var _y = ev.pageY - mouse_y;
/* 设置移动后的元素坐标 */
var now_x = (offset_x + _x) + "px";
var now_y = (offset_y + _y) + "px";
/* 改变目标元素的位置 */
obj.css({
top: now_y,
left: now_x
});
});
});
/* 当鼠标左键松开,接触事件绑定 */
$(document).bind("mouseup", function () {
$(this).unbind("mousemove");
});
$(".ac-content").append(obj);
}, 100);
});
});
</script>
</head>
<body>
<div style="height: 20px;width: 100%;">
<table style="width: 100%" cellpadding="0" cellspacing="1" border="0">
<tr>
<td>
<input type="text" class="ac-url" style="width: 100%" value="https://"/>
</td>
<td style="width: 85px;">
<button type="button" class="ac-ma" style="width: 20px"
onclick="window.fwidth=800;window.fheight=600;$('.ac-url').val('https://hastone.gitee.io/book/')">
H
</button>
<button type="button" class="ac-ma" style="width: 20px"
onclick="window.fwidth=480;window.fheight=640;">+
</button>
<button type="button" class="ac-ma" style="width: 20px"
onclick="window.fwidth=800;window.fheight=600;">++
</button>
</td>
</tr>
</table>
</div>
<div class="ac-content">
</div>
</body>
</html>