-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest.html
More file actions
46 lines (44 loc) · 1.08 KB
/
Copy pathtest.html
File metadata and controls
46 lines (44 loc) · 1.08 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<style>
#content{
background-color: rgb(79, 192, 79);
height: 60px;
color: black;
font-size: 30px;
padding:20px;
margin-top:20px;
}
</style>
<script>
let quantity=20;
let counter=1;
window.onscroll= () => {
if(window.innerHeight+window.scrollY>=document.body.offsetHeight)
{
load();
}
}
document.addEventListener('DOMContentLoaded',load)
function load(){
let start=counter;
let end=start+quantity-1;
counter=end+1;
for(let i=start;i<=end;i++)
{
let element=document.createElement('div')
element.id='content';
element.innerHTML=`Post #${i}`;
document.getElementById('body').appendChild(element);
}
}
</script>
<body id="body">
<h1 style="text-align: center;"> HELLO </h1>
</body>
</html>