-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdraft.js
More file actions
63 lines (47 loc) · 1.81 KB
/
draft.js
File metadata and controls
63 lines (47 loc) · 1.81 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
// ////ширина/высота всего документа с прокрученной частью
// let scrollHeight = Math.max(
// document.body.scrollHeight, document.documentElement.scrollHeight,
// document.body.offsetHeight, document.documentElement.offsetHeight,
// document.body.clientHeight, document.documentElement.clientHeight
// );
// /////////////////////
// let selectedTd;
// table.onclick = function (event) {
// let td = event.target.closest('td'); // (1)
// if (!td) return; // (2)
// if (!table.contains(td)) return; // (3)
// highlight(td); // (4)
// };
// function highlight(td) {
// if (selectedTd) { // убрать существующую подсветку, если есть
// selectedTd.classList.remove('highlight');
// }
// selectedTd = td;
// selectedTd.classList.add('highlight'); // подсветить новый td
// }
// ////////////////////////////////
// Счётчик: <input type="button" value="1" data-counter>
// Ещё счётчик: <input type="button" value="2" data-counter>
//
// <script>
// document.addEventListener('click', function(event) {
// if (event.target.dataset.counter != undefined) { // если есть атрибут...
// event.target.value++;
// }
// });
// </script>
// ////////////////////////
// <button data-toggle-id="subscribe-mail">
// Показать форму подписки
// </button>
// <form id="subscribe-mail" hidden>
// Ваша почта: <input type="email">
// </form>
// <script>
// document.addEventListener('click', function(event) {
// let id = event.target.dataset.toggleId;
// if (!id) return;
// let elem = document.getElementById(id);
// elem.hidden = !elem.hidden;
// });
// </script>