add new excercise
This commit is contained in:
parent
719e55a06d
commit
e12092d3b3
Binary file not shown.
After Width: | Height: | Size: 60 KiB |
|
@ -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>
|
|
@ -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";
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue