-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
73 lines (72 loc) · 3.58 KB
/
Copy pathindex.html
File metadata and controls
73 lines (72 loc) · 3.58 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
64
65
66
67
68
69
70
71
72
73
<!doctype html>
<html>
<head>
<title>HTML and CSS Examples</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="css/style.css" />
</head>
<body>
<div id="headdiv">
<h1>Learn HTML and CSS</h1>
<div class="content_Wrapper">
<div class="wrapper">
<div id="leftdiv">
<p>Following list of examples. Right click and view html source for training.</p>
<div class="example" onclick="changeContent('day1ex1.html')">Hello World!</div>
<div class="example" onclick="changeContent('day2ex1.html')">Text Formating</div>
<div class="example" onclick="changeContent('day3ex1.html')">Listing items</div>
<div class="example" onclick="changeContent('day5ex1.html')">Headings to highlight</div>
<div class="example" onclick="changeContent('day6ex1.html')">Using BackQuotes for quotes</div>
<div class="example" onclick="changeContent('Day7_Anchor/Day7ex1.html')">Linking websites</div>
<div class="example" onclick="changeContent('Day8_css/Day8ex1.html')">Applying Style to webpage</div>
<div class="example" onclick="changeContent('Day10_images/Day10ex1.html')">Adding Images to webpage</div>
<div class="example" onclick="changeContent('Day11_div/Day11ex1.html')">Formating webpages by Div</div>
</div>
<div id="rightdiv" style="border-top:3px dashed grey;">
<p>Following are list of Exercises to try. <br/>
<strong style="color:red;">Advice: Please don't view source code before trying</strong>
</p>
<div class="example" onclick="changeContent('Exercise/Exercise1')">My First Webpage</div>
<div class="example" onclick="changeContent('Exercise/HTML_CSS_Project1')">My Portfolio</div>
</div>
</div>
<div class="displayDiv">
<input id="source" type="button" value="Source" class="srcWeb" onclick="changeDisplayStyle('source')" />
<input id="webpage" type="button" value="HTMLPage" class="srcWeb" onclick="changeDisplayStyle('webpage')" />
<div id="sourceBlock" style="border: 3px solid grey; display: none;width:300px">
</div>
<div id="webpageBlock" style="border: 3px solid black; backgroundColor: black;">
<h4>Click Example or exercise to show information here !!...</h4>
</div>
</div>
</div>
</div>
<script type="text/javascript">
function changeDisplayStyle(id){
document.getElementById(id).style.backgroundColor = "black";
document.getElementById(id).style.color = "white";
document.getElementById(id + "Block").style.display= "block";
if(id.indexOf("source") > -1){
document.getElementById("webpage").style.backgroundColor = "grey";
document.getElementById("webpageBlock").style.display= "none";
}
else {
document.getElementById("source").style.backgroundColor = "grey";
document.getElementById("sourceBlock").style.display= "none";
}
}
function changeContent(path){
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (xhttp.readyState == 4 && xhttp.status == 200) {
document.getElementById("sourceBlock").firstChild.nodeValue = xhttp.responseText;
document.getElementById("webpageBlock").innerHTML = xhttp.responseText;
}
};
//alert(document.getElementById("webpage").src);
xhttp.open("GET", path, true);
xhttp.send();
}
</script>
</body>
</html>