How to apply web transition from insert to outer shadow box in div box?

I am trying to work with a web transition that starts by inserting insert tags at the ends with an external shadow box. The jsfiddle example below shows an example. The problem is the normal insertion to any shadow web transition, but pasting to the external does not work.

http://jsfiddle.net/xq4qc/

HTML

<div class="greyrow"> 
    good transition
    </div>
<br/>
<br/>
<div class="whiterow"> 
    no transition
    </div>

CSS

.greyrow{
height:100px;
width:250px;
padding:10px;
border:1px solid #CCCCCC;
margin-bottom: 10px;
-moz-box-shadow: inset 0 0 10px #aaa;
-webkit-box-shadow: inset 0 0 10px #aaa;
box-shadow: inner 0 0 10px #aaa;
}

.greyrow:hover{
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
-webkit-transition: -webkit-box-shadow 1s;
    -moz-transition: -moz-box-shadow 1s;
    -o-transition: -o-box-shadow 1s;
    transition: box-shadow 1s;


}

.whiterow{
height:100px;
width:250px;
padding:10px;
border:1px solid #CCCCCC;
margin-bottom: 10px;
-moz-box-shadow: inset 0 0 10px #aaa;
-webkit-box-shadow: inset 0 0 10px #aaa;
box-shadow: inner 0 0 10px #aaa;
}

.whiterow:hover{

-moz-box-shadow: 0 0 10px #aaa;
-webkit-box-shadow: 0 0 10px #aaa;
box-shadow: 0 0 10px #aaa;
-webkit-transition: -webkit-box-shadow 2s;
    -moz-transition: -moz-box-shadow 2s;
    -o-transition: -o-box-shadow 2s;
    transition: box-shadow 2s;


}
+5
source share
3 answers

You can come close to keyframes if you first plunged into a nickname before switching between insertion and shadow shadow. (You cannot animate this directly, because they are keywords, not numeric values, that is, the shadows are “almost Inset”).

Consider the following css:

.box {
    box-shadow: inset 0 0 10px #aaa;
    /*add prefixes*/animation: shadowFadeOut 1s;
}
.box:hover {
    box-shadow: 0 0 10px #aaa;
    /*add prefixes*/animation: shadowFadeIn 1s;
}

@/*add prefixes*/keyframes shadowFadeIn {
    0% { box-shadow: inset 0 0 10px #aaa; }
    50% { box-shadow: none; }
    100% { box-shadow: 0 0 10px #aaa; }
}

@/*add prefixes*/keyframes shadowFadeOut {
    0% { box-shadow: 0 0 10px #aaa; }
    50% { box-shadow: none; }
    100% { box-shadow: inset 0 0 10px #aaa; }
}

webkit : http://jsfiddle.net/xq4qc/1/

, , , .

+6

.

, , .

, 2 , 1 , ​​ 0 ( ):

.keyframe {
    box-shadow: inset 0 0 60px red, 0 0 0px blue;
    transition: box-shadow 5s;
}

, . :

.keyframe:hover {
    box-shadow: inset 0 0 0px red, 0 0 60px blue;
}

, , ( , "" ).

+9

. , 10px 0, 0 10px .

.outer {
  display: inline-block;
  box-shadow: 0 0 0 #000;
}
.outer:hover {
  box-shadow: 0 0 30px #000;
}
.inner {
  width: 150px;
  height: 150px;
  background: #ee3b3b;
  box-shadow: inset 0 0 30px #000;
}
.inner:hover {
  box-shadow: inset 0 0 0 #000;
}

: http://codepen.io/Probocop/pen/yyrqNG

+1

All Articles