Version - 1 - 1-38
This commit is contained in:
28
Version - 1/index.html
Normal file
28
Version - 1/index.html
Normal file
@@ -0,0 +1,28 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<title>HTML</title>
|
||||
|
||||
<!-- HTML -->
|
||||
|
||||
|
||||
<!-- Custom Styles -->
|
||||
<link rel="stylesheet" href="style.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="button1">
|
||||
<div id="red">
|
||||
red
|
||||
</div>
|
||||
<div id="green">
|
||||
green
|
||||
</div>
|
||||
</div>
|
||||
<script src="main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
13
Version - 1/main.js
Normal file
13
Version - 1/main.js
Normal file
@@ -0,0 +1,13 @@
|
||||
window.onload = function(){
|
||||
var red = document.getElementById('red');
|
||||
var green = document.getElementById('green');
|
||||
var button = document.getElementById('button1');
|
||||
button.ontouchstart = function(){
|
||||
red.style.visibility='hidden';
|
||||
green.style.visibility='visible'
|
||||
}
|
||||
button.ontouchend=function(){
|
||||
red.style.visibility='visible';
|
||||
green.style.visibility='hidden'
|
||||
}
|
||||
}
|
||||
24
Version - 1/style.css
Normal file
24
Version - 1/style.css
Normal file
@@ -0,0 +1,24 @@
|
||||
body {
|
||||
font-size: 15pt;
|
||||
user-select: none;
|
||||
}
|
||||
#red{
|
||||
position: absolute;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
background: red;
|
||||
|
||||
}
|
||||
#green{
|
||||
position: absolute;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
background: green;
|
||||
visibility: hidden;
|
||||
}
|
||||
#button1{
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
margin: -50px 0 0 -50px;
|
||||
}
|
||||
Reference in New Issue
Block a user