-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfourth.html
More file actions
42 lines (40 loc) · 1.22 KB
/
fourth.html
File metadata and controls
42 lines (40 loc) · 1.22 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
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="assets/css/fourthstyle.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="assets/js/fourthscript.js"></script>
</head>
<body>
<a href="fifth.html" id="title">Next.</a>
<div id="content">
<div class="row" id="row1">
<!-- adds number of hexagons to the first row -->
<script type="text/javascript">
var hexagon = 36
addHex = function (i) {
let addedHex = '<div class="hexagon ' + String(i)
addedHex += '"><img src="assets/img/hexagondarknicegreen.png"></div>'
$('#row1').append(addedHex)
}
for (hexagon; hexagon; hexagon--) {
addHex(hexagon);
}
</script>
</div>
<!-- copies first row i number of times, with id=rowi
also moves every second row over to keep rows properly aligned-->
<script type="text/javascript">
function copyRow(i) {
$("#row1").clone().prop({ id: "row" + String(i)}).appendTo("#content");
if (i % 2 == 0) {
$("#row" + String(i)).css({"position": "relative", "left": "21px"});
}
}
for (i = 2; i < 24; i++) {
copyRow(i);
}
</script>
</div>
</body>
</html>