Difference between revisions of "Team:BostonU/Collaborations"

Line 15: Line 15:
 
    
 
    
 
#box-shadow-div{
 
#box-shadow-div{
position: fixed;
 
 
width:50px;
 
width:50px;
 +
 +
position: fixed;
 
}
 
}
 
</style>
 
</style>
 
          
 
          
 
<script type="text/javascript">
 
<script type="text/javascript">
            window.onload = function(){
+
$(document).ready(
                var x, y;
+
     function(){
     // On mousemove use event.clientX and event.clientY to set the location of the div to the location of the cursor:
+
$("#main").mousemove(function(e){
                window.addEventListener('mousemove', function(event){
+
      $('#box-shadow-div').animate({'top': e.clientY - 20, 'left': e.clientX - 20}, 1);
                    x = event.clientX;
+
});
                    y = event.clientY;                 
+
});
                    if ( typeof x !== 'undefined' ){
+
 
                        $("#box-shadow-div").animate({"left": (x-20) + "px"}, 1);
+
                        $("#box-shadow-div").animate({"top": (y-20) + "px"}, 1);
+
                    }
+
                }, false);
+
            };
+
 
</script>
 
</script>
  
Line 53: Line 49:
  
 
<body>
 
<body>
         <div style = "width:1000px; height:1000px;">
+
         <div style = "width:1000px; height:1000px;" id = "main">
 
         <img src = "https://static.igem.org/mediawiki/2016/e/ee/T--BostonU--twitterlogo.png" id="box-shadow-div"><br><br><br><br>
 
         <img src = "https://static.igem.org/mediawiki/2016/e/ee/T--BostonU--twitterlogo.png" id="box-shadow-div"><br><br><br><br>
 
         <div id = "test" style = "width:50px; height:50px; background-color:blue;">
 
         <div id = "test" style = "width:50px; height:50px; background-color:blue;">

Revision as of 20:51, 4 August 2016

box-shadow-experiment