Created
March 2, 2012 16:23
-
-
Save timruffles/1959447 to your computer and use it in GitHub Desktop.
torch light in css
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js" type="text/javascript" charset="utf-8"></script> | |
| <script type="text/javascript" charset="utf-8"> | |
| $(function() { | |
| $(".masker").mousemove(function(e) { | |
| $(this).css("-webkit-mask","-webkit-radial-gradient(" + e.clientX + " " + e.clientY + ", 170 120, rgba(0,0,0,0) 40%, rgba(0,0,0,1)) 10%") | |
| }) | |
| }) | |
| </script> | |
| <style type="text/css" media="screen"> | |
| .masker { | |
| background: #000; | |
| position: absolute; | |
| width: 100%; | |
| height: 100%; | |
| z-index: 5; | |
| } | |
| .content { | |
| height: 100%; | |
| } | |
| .item { | |
| height: 100px; | |
| width: 100px; | |
| } | |
| .one { | |
| position: absolute; | |
| top: 25%; | |
| left: 25%; | |
| background: red; | |
| } | |
| .wrap { | |
| position: relative; | |
| } | |
| </style> | |
| <div class="wrap"> | |
| <div class="masker"> | |
| </div> | |
| <div class="content"> | |
| <div class="item one">Hello</div> | |
| <div class="item two">Yovus</div> | |
| </div> | |
| </div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment