Team:UCLA
From 2013.igem.org
(Difference between revisions)
Dewalgupta (Talk | contribs) |
Dewalgupta (Talk | contribs) |
||
Line 12: | Line 12: | ||
top: 350px; | top: 350px; | ||
width: 100%; | width: 100%; | ||
+ | font-size: 5em; | ||
} | } | ||
#content { | #content { | ||
Line 20: | Line 21: | ||
</head> | </head> | ||
<body> | <body> | ||
+ | <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> | ||
+ | <script>$(document).ready(function(){ | ||
+ | $('section[data-type="background"]').each(function(){ | ||
+ | var $bgobj = $(this); // assigning the object | ||
+ | |||
+ | $(window).scroll(function() { | ||
+ | var yPos = -($window.scrollTop() / $bgobj.data('speed')); | ||
+ | |||
+ | // Put together our final background position | ||
+ | var coords = '50% '+ yPos + 'px'; | ||
+ | |||
+ | // Move the background | ||
+ | $bgobj.css({ backgroundPosition: coords }); | ||
+ | }); | ||
+ | }); | ||
+ | }); | ||
+ | </script> | ||
<section id="slide" data-type="background" data-speed="10"><br><br><article>WELCOME TO UCLA IGEM</article><br><br><br><br> | <section id="slide" data-type="background" data-speed="10"><br><br><article>WELCOME TO UCLA IGEM</article><br><br><br><br> | ||
</section> | </section> |
Revision as of 22:38, 25 September 2013