Skip to content

Instantly share code, notes, and snippets.

@kodamirmo
Created May 31, 2016 16:29
Show Gist options
  • Save kodamirmo/47487655dc289e8ef154a2906614c148 to your computer and use it in GitHub Desktop.
Save kodamirmo/47487655dc289e8ef154a2906614c148 to your computer and use it in GitHub Desktop.
#container {
width: 800px;
height: 600px;
position: relative;
}
.tamano {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
}
#texto {
background-color:rgba(255,0,0,0.5);
}
$(document).ready(function() {
console.log(':D');
$('#texto').hide();
$('#container').mouseover(function(){
console.log('Focus');
$('#texto').show();
});
$('#container').mouseleave(function(){
console.log('Focusggggg');
$('#texto').hide();
});
});
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Smash Faces</title>
<link rel="stylesheet" href="css/main.css">
</head>
<body>
<div id="container">
<div class="tamano" id="imagen">
<img src="http://www.proify.com/wp-content/uploads/2015/04/landscape-photography-competition.jpg">
</div>
<div class="tamano" id="texto">
<h1>BIEN</h1>
</div>
</div>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.1.js">
</script>
<script src="js/main.js"></script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment