Created
October 11, 2013 13:46
-
-
Save crystianwendel/6934917 to your computer and use it in GitHub Desktop.
Atividade 2 javascript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Titulo</title> | |
<link rel="stylesheet" type="text/css" href="estilo.css"/> | |
<style rel="stylesheet" type="text/css"> | |
#popup { | |
width: 200px; | |
height: 200px; | |
border: 1px solid red; | |
position: fixed; | |
top: 10%; | |
left: 20%; | |
background-color: #CCC; | |
} | |
.shown { | |
display: block; | |
} | |
.hidden { | |
display: none; | |
} | |
.close-button { | |
float: right; | |
} | |
</style> | |
</head> | |
<body> | |
<h1>Titulo <button onclick="popup();">pop-up</button></h1> | |
<p>Parágrafo Parágrafo Parágrafo Parágrafo Parágrafo</p> | |
<h1>Titulo</h1> | |
<p>Parágrafo Parágrafo Parágrafo Parágrafo Parágrafo</p> | |
<h1>Titulo</h1> | |
<p>Parágrafo Parágrafo Parágrafo Parágrafo Parágrafo</p> | |
<div id="popup" class="hidden"> | |
<button class="close-button" onclick="fecharpopup();">X</button> | |
</div> | |
<script language="javascript"> | |
function popup() { | |
document.getElementById('popup').className = "shown"; | |
} | |
function fecharpopup() { | |
document.getElementById('popup').className = "hidden"; | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment