Line 1: | Line 1: | ||
{{BostonU_we_tryin}} | {{BostonU_we_tryin}} | ||
<html> | <html> | ||
− | <head> | + | <head> |
− | < | + | <title>box-shadow-experiment</title> |
− | + | <style type="text/css"> | |
#sideMenu, #top_title {display:none;} | #sideMenu, #top_title {display:none;} | ||
body {background-color:white; } | body {background-color:white; } | ||
Line 13: | Line 13: | ||
margin:0 auto; | margin:0 auto; | ||
} | } | ||
− | + | #box-shadow-div{ | |
− | # | + | position: fixed; |
− | + | width: 1px; | |
− | + | height: 1px; | |
− | + | border-radius: 100%; | |
− | + | background-color:black; | |
− | + | box-shadow: 0 0 10px 10px black; | |
− | + | top: 49%; | |
− | + | left: 48.85%; | |
− | + | } | |
− | + | </style> | |
− | + | <script type="text/javascript"> | |
− | } | + | window.onload = function(){ |
− | + | var bsDiv = document.getElementById("box-shadow-div"); | |
− | </style> | + | var x, y; |
− | + | // On mousemove use event.clientX and event.clientY to set the location of the div to the location of the cursor: | |
− | + | window.addEventListener('mousemove', function(event){ | |
− | + | x = event.clientX; | |
− | + | y = event.clientY; | |
− | + | if ( typeof x !== 'undefined' ){ | |
− | <script type="text/javascript"> | + | bsDiv.style.left = x-5 + "px"; |
− | + | bsDiv.style.top = y-5 + "px"; | |
− | + | } | |
− | }); | + | }, false); |
− | </script> | + | } |
+ | </script> | ||
+ | </head> | ||
+ | <body> | ||
+ | <div id="box-shadow-div"></div> | ||
+ | </body> | ||
+ | </html> |
Revision as of 19:45, 4 August 2016