I'm attempting to create a garage door effect on my website, where upon loading the page, a garage door is displayed. Upon hovering over the door, it lifts up to reveal the content behind it. The challenge I'm facing is keeping the content hidden until the door lifts. Any suggestions or ideas would be greatly appreciated. You can view the site here:
If you need the code, I can provide that as well.
<div id="wrapper">
<div id="container">
<img src="./images/Logo_door.png" class="top">
<section id="main">
<!-- main content here -->
</section>
<footer id="footer">
<!-- video and map section -->
<div id="video">
<iframe class="hidden" width="363" height="187" src="http://www.youtube.com/embed/Pd00CAw15-E?wmode=transparent" frameborder="0" allowfullscreen></iframe>
</div>
<div id="map">
</div>
</footer>
</div>
</div>
Here is the CSS for the design:
body {
background:url('../images/background1.jpg');
background-repeat:repeat-y repeat-x;
}
#wrapper {
background:url('../images/background2.gif');
display:block;
height:600px;
width:900px;
padding:10px 0 10px 0;
margin:auto;
border-radius:15px;
}
footer {
margin:auto;
width:800px;
height:200px;
}
#main {
height:350px;
margin:0px 50px 50px 50px;
width:800px;
border-radius:15px;
padding:0;
-moz-box-shadow: inset 0 0 5px 5px #888;
-webkit-box-shadow: inset 0 0 5px 5px#888;
box-shadow: inset 0 0 5px 5px #888;
}
#video {
background:black;
padding:0;
margin:0px 0px 0px 25px;
float:right;
width:375px;
height:200px;
border-radius:10px;
-moz-box-shadow: inset 0 0 5px 5px #888;
-webkit-box-shadow: inset 0 0 5px 5px#888;
box-shadow: inset 0 0 5px 5px #888;
}
#video iframe {
margin:6px 0 0 6px;
}
#map {
padding:0;
margin:0px 25px 0px 0px;
border-radius:10px;
float:left;
width:375px;
height: 200px;
-moz-box-shadow: inset 0 0 5px 5px #888;
-webkit-box-shadow: inset 0 0 5px 5px#888;
box-shadow: inset 0 0 5px 5px #888;
}
.top {
margin:auto;
height:700px;
width:900px;
padding:0;
position:absolute;
}
Below is the jQuery code I am using:
$(function() {
$('#wrapper').hover(function() {
$('img.top', $(this)).stop().animate({top: '-900px'}, 1000);
},function() {
$('img.top', $(this)).stop().animate({top: '10px'}, 1000);
})
});