Team:Cornell/sandbox
From 2013.igem.org
(Difference between revisions)
Line 7: | Line 7: | ||
<!--Fixes IE browser older than IE9> | <!--Fixes IE browser older than IE9> | ||
<script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE9.js"></script> | <script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE9.js"></script> | ||
+ | document.createElement("article"); | ||
+ | document.createElement("section"); | ||
<!-- Removes iGEM Wiki Stuff --> | <!-- Removes iGEM Wiki Stuff --> | ||
Line 97: | Line 99: | ||
} | } | ||
</style> | </style> | ||
+ | <script> | ||
+ | $(document).ready(function(){ | ||
+ | $('section[data-type="background"]').each(function(){ | ||
+ | var $bgobj = $(this); //assigning the object | ||
+ | $(window).scroll(function(){ | ||
+ | var yPos = -($window.scrollTop()/$bgogb.data('speed')); | ||
+ | |||
+ | var coords = '50%' + yPos + 'px'; //background position | ||
+ | $bgobj.css({backgroundPosition: coords }); //move background | ||
+ | }); | ||
+ | }); | ||
+ | }); | ||
+ | </script> | ||
</head> | </head> | ||
<body> | <body> |
Revision as of 16:21, 23 December 2013