Team:Cornell/sandbox

From 2013.igem.org

(Difference between revisions)
Line 9: Line 9:
<!-- Remove all empty <p> tags -->
<!-- Remove all empty <p> tags -->
-
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
+
<script type="text/javascript">
     $(document).ready(function() {
     $(document).ready(function() {
         $("p").filter( function() {
         $("p").filter( function() {
Line 315: Line 315:
----------------------------------------- */
----------------------------------------- */
.section {         
.section {         
-
background-image: url("https://static.igem.org/mediawiki/2013/a/ab/Mold_contaminantssmaller.jpg");
+
position: absolute;
-
height: 329px;
+
}
}
.section .inner {  
.section .inner {  
-
background-image: url("https://static.igem.org/mediawiki/igem.org/6/67/IGEMsmall.png");
+
z-index: 2;
-
height: 100px;
+
position: fixed;
-
background-repeat: no-repeat;
+
}
}
Line 329: Line 327:
</style>
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
-
+
$(window).bind('scroll',function(e){
 +
parallaxScroll();
 +
});
 +
 +
function parallaxScroll(){
 +
var scrolled = $(window).scrollTop();
 +
$('.section').css('top',(0-(scrolled*.25))+'px');
 +
$('.inner').css('top',(0-(scrolled*.5))+'px');
 +
}
</script>
</script>
</head>
</head>
Line 338: Line 344:
<div class="section">
<div class="section">
<div class="inner">
<div class="inner">
-
+
Texty text
-
</div>
+
-
</div>
+
-
<div class="constant">
+
-
</div>
+
-
<div class="section">
+
-
<div class="inner">
+
</div>
</div>

Revision as of 17:04, 26 December 2013

Parallax Test

Whee

Texty text