-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjs-base.js
More file actions
38 lines (34 loc) · 870 Bytes
/
js-base.js
File metadata and controls
38 lines (34 loc) · 870 Bytes
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
function ulControl() {
var sign = document.createElement("sign");
sign.innerHTML = "++++++";
$("ul").before(sign);
$("ol").before(sign);
$("pre").before(sign);
$("sign").click(function () {
$(this).next().toggle();
});
$("ul").dblclick(function () {
$(this).toggle();
});
$("ol").dblclick(function () {
$(this).toggle();
});
$("pre").dblclick(function () {
$(this).toggle();
});
$("sign").next().hide();
$("sign").css("display", "block");
}
function setCenter() {
if (window.screen.width > window.screen.height) {
$("body").width("50%");
$("body").css({
position: "absolute",
left: $(window).width()/4
});
}
}
$(document).ready(function () {
ulControl();
setCenter();
});