Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

inner border radius does not work

Tags:

html

jquery

css

I have a question about border radius. Basically I am using code to create a sort of spotlight tool to find hidden html. Here is the fiddle: http://jsfiddle.net/pwneth/hj57k/1899/

css:

#tail {
border: 1000px solid #fff;
position: absolute;
float: left;
height: 100px;
width: 100px;
background-color: rgba(0,0,0,.0);
z-index: 100;
top: 0px;
left: 0px;
pointer-events:none;
-moz-box-shadow:    inset 0 0 20px #000000;
-webkit-box-shadow: inset 0 0 20px #000000;
box-shadow:         inset 0 0 20px #000000;
}

I need to somehow set the border radius of the shape to make it appear as a circle. This is a problem however because this only effects the outside border, which is not something I want to effect. Just the inside of the border.

like image 582
mpn Avatar asked Jan 12 '23 09:01

mpn


1 Answers

Here's a simpler option:

Fiddle

Just put the border-radius on the original element.

#tail
{
    /* ... */
    border-radius:100%;
}

Then just hide everything until the mouse has been over it.

body /* or whatever element you want */
{
    display:none;
}

Then do this:

$(document).bind('mouseenter', function (e) {
    $('body').show();
});
$('body').bind('mouseleave', function (e) {
    $(this).hide();
});

This way users will never see the hidden content.

like image 168
musicnothing Avatar answered Jan 16 '23 01:01

musicnothing