2016-09-09 14 views
2

Chromeで華やかに見えるCSSに涼しい"pop"ホバー効果を使用しています。IEでCSSアニメーション効果を無効にする

ただし、Internet Explorer 11(およびそれ以下)では、ホバーで空白になってから黒くなります。

これをIEで無効にする方法はありますか、それとも簡単に消えてしまうグリッチを修正する方法はありますか?

デモ:http://jsfiddle.net/0hLLkyh3/

@import url(http://fonts.googleapis.com/css?family=Roboto); 
 
h2 { 
 
    font-size: 18px; 
 
    margin-bottom: 20px; 
 
    line-height: 28px; 
 
    margin-top: 0; 
 
    font-weight: 900; 
 
} 
 
.effects {} body { 
 
    margin: 0 auto; 
 
    max-width: 800px; 
 
    padding: 40px 20px 20px 20px; 
 
    font-family: sans-serif; 
 
    color: #333; 
 
    line-height: 140%; 
 
} 
 
img { 
 
    border: none; 
 
} 
 
small { 
 
    display: block; 
 
} 
 
p, 
 
[class^="hvr-"] { 
 
    font-family: 'Roboto', sans-serif; 
 
} 
 
[class^="hvr-"] { 
 
    /*display: inline-block;*/ 
 
    /*vertical-align: middle;*/ 
 
    margin: .4em; 
 
    padding: 1em; 
 
    cursor: pointer; 
 
    background: #e1e1e1; 
 
    text-decoration: none; 
 
    color: #666; 
 
    /* Prevent highlight colour when element is tapped */ 
 
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0); 
 
} 
 
.aligncenter { 
 
    text-align: center; 
 
} 
 
a { 
 
    color: #2098D1; 
 
    text-decoration: none; 
 
} 
 
.mt-30 { 
 
    margin-top: 30px; 
 
} 
 
a:hover { 
 
    background: black 
 
} 
 
/*! 
 
    * Hover.css (http://ianlunn.github.io/Hover/) 
 
    * Version: 2.0.2 
 
    * Author: Ian Lunn @IanLunn 
 
    * Author URL: http://ianlunn.co.uk/ 
 
    * Github: https://github.com/IanLunn/Hover 
 
    
 
    * Made available under a MIT License: 
 
    * http://www.opensource.org/licenses/mit-license.php 
 
    
 
    * Hover.css Copyright Ian Lunn 2014. Generated with Sass. 
 
    */ 
 

 
/* 2D TRANSITIONS */ 
 

 
/* Pop */ 
 

 
@-webkit-keyframes web-hvr-pop { 
 
    50% { 
 
    -webkit-transform: scale(1.2); 
 
    transform: scale(1.2); 
 
    } 
 
} 
 
@keyframes hvr-pop { 
 
    50% { 
 
    -webkit-transform: scale(1.2); 
 
    transform: scale(1.2); 
 
    } 
 
} 
 
.hvr-pop { 
 
    display: inline-block; 
 
    vertical-align: middle; 
 
    -webkit-transform: translateZ(0); 
 
    transform: translateZ(0); 
 
    box-shadow: 0 0 1px rgba(0, 0, 0, 0); 
 
    -webkit-backface-visibility: hidden; 
 
    backface-visibility: hidden; 
 
    -moz-osx-font-smoothing: grayscale; 
 
} 
 
.hvr-pop:hover, 
 
.hvr-pop:focus, 
 
.hvr-pop:active { 
 
    -webkit-animation-name: web-hvr-pop; 
 
    animation-name: hvr-pop; 
 
    -webkit-animation-duration: 0.3s; 
 
    animation-duration: 0.3s; 
 
    -webkit-animation-timing-function: linear; 
 
    animation-timing-function: linear; 
 
    -webkit-animation-iteration-count: 1; 
 
    animation-iteration-count: 1; 
 
}
<div class="effects"> 
 
    <a class="hvr-pop" href="#">Pop</a> 
 
</div>

+2

IE11でテストされ、期待通りに動作します。「グリッチ」は見られません。 –

+2

@ ADreNaLiNe-DJ Weeeird言及する最初の人ではありません。私は互換性ビューを有効/無効にしていて、同じ「ホバリング、空白になり、次に黒くなります」という結果を得ています。 – michaelmcgurk

答えて

3

-ms-animation-name:none;

@import url(http://fonts.googleapis.com/css?family=Roboto); 
 
h2{ 
 
    font-size:18px; 
 
    margin-bottom: 20px; 
 
    line-height: 28px; 
 
    margin-top:0; 
 
    font-weight: 900; 
 
} 
 
.effects{ 
 
    
 
} 
 
body { 
 
    margin: 0 auto; 
 
    max-width: 800px; 
 
    padding: 40px 20px 20px 20px; 
 
    font-family: sans-serif; 
 
    color: #333; 
 
    line-height: 140%; 
 
} 
 
img { 
 
    border: none; 
 
} 
 
small { 
 
    display: block; 
 
} 
 
p, [class^="hvr-"] { 
 
    font-family:'Roboto', sans-serif; 
 
} 
 
[class^="hvr-"] { 
 
    /*display: inline-block;*/ 
 
    /*vertical-align: middle;*/ 
 
    margin: .4em; 
 
    padding: 1em; 
 
    cursor: pointer; 
 
    background: #e1e1e1; 
 
    text-decoration: none; 
 
    color: #666; 
 
    /* Prevent highlight colour when element is tapped */ 
 
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0); 
 
} 
 
.aligncenter { 
 
    text-align: center; 
 
} 
 

 
a { 
 
    color: #2098D1; 
 
    text-decoration: none; 
 
} 
 

 
.mt-30{ 
 
    margin-top:30px; 
 
} 
 

 
a:hover { 
 
    background:black 
 
} 
 

 
/*! 
 
* Hover.css (http://ianlunn.github.io/Hover/) 
 
* Version: 2.0.2 
 
* Author: Ian Lunn @IanLunn 
 
* Author URL: http://ianlunn.co.uk/ 
 
* Github: https://github.com/IanLunn/Hover 
 

 
* Made available under a MIT License: 
 
* http://www.opensource.org/licenses/mit-license.php 
 

 
* Hover.css Copyright Ian Lunn 2014. Generated with Sass. 
 
*/ 
 
/* 2D TRANSITIONS */ 
 

 
/* Pop */ 
 
@-webkit-keyframes web-hvr-pop { 
 
    50% { 
 
    -webkit-transform: scale(1.2); 
 
    transform: scale(1.2); 
 
    } 
 
} 
 

 
@keyframes hvr-pop { 
 
    50% { 
 
    -webkit-transform: scale(1.2); 
 
    transform: scale(1.2); 
 
    } 
 
} 
 

 
.hvr-pop { 
 
    display: inline-block; 
 
    vertical-align: middle; 
 
    -webkit-transform: translateZ(0); 
 
    transform: translateZ(0); 
 
    box-shadow: 0 0 1px rgba(0, 0, 0, 0); 
 
    -webkit-backface-visibility: hidden; 
 
    backface-visibility: hidden; 
 
    -moz-osx-font-smoothing: grayscale; 
 
} 
 
.hvr-pop:hover, .hvr-pop:focus, .hvr-pop:active { 
 
    -webkit-animation-name: web-hvr-pop; 
 
    -moz-animation-name: web-hvr-pop; 
 
    animation-name: hvr-pop; 
 
    -ms-animation-name:none; 
 
    -moz-animation-duration: 0.3s; 
 
    -webkit-animation-duration: 0.3s; 
 
    animation-duration: 0.3s; 
 
    -webkit-animation-timing-function: linear; 
 
    animation-timing-function: linear; 
 
    -webkit-animation-iteration-count: 1; 
 
    animation-iteration-count: 1; 
 
}
<div class="effects"> 
 
    <a class="hvr-pop" href="#">Pop</a> 
 
</div>

ことを修正するだろう3210
+1

うわー - @Hitesh - あなたは私のヒーローです! :-D – michaelmcgurk

+1

これは素晴らしい@michaelのように聞こえる。がんばろう :) –

関連する問題