Advertisement
Guest User

Untitled

a guest
Nov 27th, 2011
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.77 KB | None | 0 0
  1. <style>
  2.   html, body {
  3.     border: 0;
  4.     margin: 0;
  5.   } .axis {
  6.     position: absolute;
  7.     background-color: #000000;
  8.     top: -1px;
  9.     left: -1px;
  10.     z-index: -1;
  11.   } #x {
  12.     width: 100%;
  13.     height: 1px;
  14.     left: 0px;
  15.   } #y {
  16.     width: 1px;
  17.     height: 100%;
  18.     top: 0px;
  19.   }
  20. </style>
  21. <body>
  22.   <h1>Content</h1>
  23.   <h2>Content</h2>
  24.   <h3>Content</h3>
  25.   <h4>Content</h4>
  26.   <h5>Content</h5>
  27.   <h6>Content</h6>
  28.   <h1>Content</h1>
  29.   <h2>Content</h2>
  30.   <h3>Content</h3>
  31.   <h4>Content</h4>
  32.   <h5>Content</h5>
  33.   <h6>Content</h6>
  34.   <h1>Content</h1>
  35.   <h2>Content</h2>
  36.   <h3>Content</h3>
  37.   <h4>Content</h4>
  38.   <h5>Content</h5>
  39.   <h6>Content</h6>
  40.   <h1>Content</h1>
  41.   <h2>Content</h2>
  42.   <h3>Content</h3>
  43.   <h4>Content</h4>
  44.   <h5>Content</h5>
  45.   <h6>Content</h6>
  46.   <h1>Content</h1>
  47.   <h2>Content</h2>
  48.   <h3>Content</h3>
  49.   <h4>Content</h4>
  50.   <h5>Content</h5>
  51.   <h6>Content</h6>
  52.   <h1>Content</h1>
  53.   <h2>Content</h2>
  54.   <h3>Content</h3>
  55.   <h4>Content</h4>
  56.   <h5>Content</h5>
  57.   <h6>Content</h6>
  58. </body>
  59. <script>
  60.   var x = document.createElement("div"),
  61.       y = x.cloneNode(false);
  62.   x.className = y.className = "axis";
  63.   x.id = "x"; y.id = "y";
  64.   x.appendChild(document.createTextNode(" "));
  65.   document.body.appendChild(x);
  66.   document.body.appendChild(y);
  67.   ("onmousemove" in this?this:document.body).onmousemove = function(e) {
  68.     e = e || event;
  69.     x.style.top  = e.clientY + document.body.scrollTop  + document.documentElement.scrollTop + "px";
  70.     y.style.left = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft + "px";
  71.   }; ("onscroll" in this?this:document.body).onscroll = function(e) {
  72.     x.style.left = document.body.scrollLeft + document.documentElement.scrollLeft + "px";
  73.     y.style.top  = document.body.scrollTop  + document.documentElement.scrollTop  + "px";
  74.   };
  75. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement