Team:UCLA/Template/Javascript

From 2014.igem.org

(Difference between revisions)
Line 134: Line 134:
$('html,body').animate({scrollTop:dest}, 700,'swing');
$('html,body').animate({scrollTop:dest}, 700,'swing');
});
});
 +
</script>
 +
 +
<!--SPIDER-->
 +
<script>
 +
var mouseY = 0;
 +
$(document).mousemove(function(e){
 +
  mouseY = e.pageY;
 +
});
 +
 +
// cache the selector
 +
var follower = $("#follower");
 +
var yp = 0;
 +
var loop = setInterval(function(){
 +
    // change 12 to alter damping higher is slower
 +
    yp += (mouseY - yp) / 12;
 +
    follower.css({top:yp});
 +
   
 +
}, 30);
</script>
</script>

Revision as of 21:26, 13 August 2014