Template:Kyoto/myScroll

From 2012.igem.org

(Difference between revisions)
 
Line 3: Line 3:
function setScroll(element) {
function setScroll(element) {
     element.css("position","relative");
     element.css("position","relative");
-
     window.onscroll = function() {
+
     $(window).scroll(function() {
         var parent = element.parent();
         var parent = element.parent();
         var scroll_top = $(window).scrollTop();
         var scroll_top = $(window).scrollTop();
Line 13: Line 13:
             element.css("top","0px");
             element.css("top","0px");
         }
         }
-
     };
+
     });
}</script>
}</script>
</html>
</html>

Latest revision as of 02:43, 26 September 2012