add new excercise

This commit is contained in:
Andreas Zweili 2017-06-24 11:40:00 +02:00
parent 719e55a06d
commit e12092d3b3
3 changed files with 35 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

View File

@ -0,0 +1,23 @@
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<script type="text/javascript" src="task_2.js"></script>
<title>JavaScript</title>
</head>
<body>
<h1>JavaScript</h1>
<p>
<input type="button" value="fadeIn" onclick="changeOpacity();"/>
</p>
<div style="position: absolute;">
<div style="position: absolute; top: 10px; left:10px;">
<img src="sky.jpg" />
</div>
<div id="over" style="position: absolute; top: 10px; lef: 10px;
width: 500px height: 375px; background: black;
opacity: 1.0;">
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,12 @@
var value = 1.0;
var titleSize = 10;
function changeOpacity(){
if (value >= 0.00) {
value = value - 0.05;
var over = document.getElementById("over");
over.style.opacity = value;
over.style.backgroundColor = "green";
}
}