Team:UCLA/Template/Javascript

From 2014.igem.org

(Difference between revisions)
Line 148: Line 148:
var loop = setInterval(function(){
var loop = setInterval(function(){
     // change 12 to alter damping higher is slower
     // change 12 to alter damping higher is slower
-
    yp += (mouseY - yp) / 12;
 
-
    follower.css({top:yp});
 
-
   
 
-
}, 30);
 
-
</script>
 
-
 
-
<!--SPIDER-->
 
-
<script>
 
-
var mouseY = 0;
 
-
$(document).mousemove(function(e){
 
-
  mouseY = e.pageY;
 
-
});
 
-
 
-
var follower = $("#follower");
 
-
var yp = 0;
 
-
var loop = setInterval(function(){
 
-
 
     yp += (mouseY - yp) / 12;
     yp += (mouseY - yp) / 12;
     follower.css({top:yp});
     follower.css({top:yp});

Revision as of 21:30, 13 August 2014