Skip to content

Instantly share code, notes, and snippets.

@JustinChristensen
Forked from anonymous/gist:4367300
Last active December 10, 2015 02:29
Show Gist options
  • Save JustinChristensen/4367304 to your computer and use it in GitHub Desktop.
Save JustinChristensen/4367304 to your computer and use it in GitHub Desktop.
<style>
#box1 {
position:absolute;
top:0;
left:0;
width:100%;
height:100%;
z-index:-1;
opacity: 0;
background: transparent url(img/back1.jpg);
background-repeat: no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
display: none;
}
</style>
<div id="box1" class="box"></div>
<script type="text/javascript">
var i = 0, boxtmp;
if (i === 0) {
boxtmp='box1';
$("#"+boxtmp).animate( {opacity: 1, display: "inline"}, 2000 );
i = 1;
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment