- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 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
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="css/style.css">
<!--[if IE]>
<script src="https://raw.githubusercontent.com/aFarkas/html5shiv/master/dist/html5shiv.min.js"></script>
<![endif]-->
<style>
article, aside, details, figcaption, figure, footer,header,
hgroup, menu, nav, section { display: block; }
#moving-div {
border: 5px groove green;
padding: 5px;
margin: 10px;
background-color: yellow;
}
</style>
</head>
<body>
Before Before Before
<div id="moving-div">
Text Text Text<br>
Text Text Text<br>
</div>
After After After
<script type="text/javascript">
'use strict';
let empty = document.createElement('div');
let mdiv = document.getElementById('moving-div');
let cs = getComputedStyle(mdiv);
function clone_Node(elem) { //плохая релизация глючит:(((
let r = document.createElement(elem.tagName);
for(let k of getComputedStyle(elem)) {
try {
r.style[k] = getComputedStyle(elem)[k];
}
catch(e) { /*пофиг!*/ }
}
r.innerHTML = elem.innerHTML;
return r;
}
let copy = mdiv.cloneNode(true);
mdiv.style.opacity = '0';
copy.style.position = 'absolute';
copy.style.right = copy.style.top = 0;
mdiv.after(copy);
</script>
</body>
</html>
Комментарии (0) RSS
Добавить комментарий