2016-04-13 67 views
3

我正在使用彈出在屏幕右側的四個圖標的菜單。屏幕右側顯示一個箭頭(east-exit-icon),如果將鼠標懸停在上面,則會顯示另外四個圖標(communicating-icon) 這適用於每個瀏覽器,但FireFox都適用。 有誰能幫我解決這個問題?在Firefox中懸停的CSS過渡動畫

html { 
 
    width: 100%; 
 
    height: 100%; 
 
    position: absolute; 
 
    overflow: hidden; 
 
    font-family: 'Roboto', sans-serif; 
 
} 
 

 
#east-exit { 
 
    display: flex; 
 
    opacity: 1; 
 
    z-index: -1; 
 
    align-items: stretch; 
 
    justify-content: space-around; 
 
    flex-direction: column; 
 
    position: absolute; 
 
    right: 0; 
 
    height: 100%; 
 
    width: 85px; 
 
    font-size: 55px; 
 
} 
 

 
.east-exit-icon { 
 
    -webkit-transition: all .2s ease; 
 
    -moz-transition: all .2s ease; 
 
    -o-transition: all .2s ease; 
 
    -ms-transition: all .2s ease; 
 
    transition: all .2s ease; 
 
    font-size: 45px; 
 
    opacity: 0.1; 
 
} 
 

 
#east-exit:hover .east-exit-icon { opacity: 0; } 
 

 
.communicate-icon { 
 
    z-index: 1; 
 
    -webkit-transition: all .3s ease; 
 
    -moz-transition: all .3s ease; 
 
    -o-transition: all .3s ease; 
 
    -ms-transition: all .3s ease; 
 
    transition: all .3s ease; 
 
    color: darkgrey; 
 
    opacity: 0; 
 
} 
 

 
#east-exit:hover .communicate-icon { opacity: 1; } 
 

 
.communicate-icon:hover, 
 
.communicate-icon:focus, 
 
.communicate-icon:active { 
 
    -webkit-transform: scale(1.2); 
 
    transform: scale(1.2); 
 
    -webkit-transition-timing-function: cubic-bezier(0.47, 2.02, 0.31, -0.36); 
 
    transition-timing-function: cubic-bezier(0.47, 2.02, 0.31, -0.36); 
 
    color: grey; 
 
    cursor: pointer; 
 
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.1/css/font-awesome.min.css" rel="stylesheet"/> 
 

 
<div id="east-exit"> 
 
    <a><i class="communicate-icon fa fa-envelope"></i></a> 
 
    <a><i class="communicate-icon fa fa-comments"></i></a> 
 
    <i class="east-exit-icon fa fa-arrow-right"></i> 
 
    <a><i class="communicate-icon fa fa-phone"></i></a> 
 
    <a><i class="communicate-icon fa fa-camera"></i></a> 
 
</div>

編輯:https://jsfiddle.net/grhajrbp/

+3

你能提供一個jsfiddle嗎? – fbid

+0

是的,我很抱歉爲了讓小提琴奏效,我不得不放棄一些代碼。 https://jsfiddle.net/grhajrbp/ – Mayia

回答

2

只是刪除您z-index: -1;#東口

html { 
 
    width: 100%; 
 
    height: 100%; 
 
    position: absolute; 
 
    overflow: hidden; 
 
    font-family: 'Roboto', sans-serif; 
 
} 
 

 
#east-exit { 
 
    display: flex; 
 
    opacity: 1; 
 
    align-items: stretch; 
 
    justify-content: space-around; 
 
    flex-direction: column; 
 
    position: absolute; 
 
    right: 0; 
 
    height: 100%; 
 
    width: 85px; 
 
    font-size: 55px; 
 
} 
 

 
.east-exit-icon { 
 
    -webkit-transition: all .2s ease; 
 
    -moz-transition: all .2s ease; 
 
    -o-transition: all .2s ease; 
 
    -ms-transition: all .2s ease; 
 
    transition: all .2s ease; 
 
    font-size: 45px; 
 
    opacity: 0.1; 
 
} 
 

 
#east-exit:hover .east-exit-icon { opacity: 0; } 
 

 
.communicate-icon { 
 
    z-index: 1; 
 
    -webkit-transition: all .3s ease; 
 
    -moz-transition: all .3s ease; 
 
    -o-transition: all .3s ease; 
 
    -ms-transition: all .3s ease; 
 
    transition: all .3s ease; 
 
    color: darkgrey; 
 
    opacity: 0; 
 
} 
 

 
#east-exit:hover .communicate-icon { opacity: 1; } 
 

 
.communicate-icon:hover, 
 
.communicate-icon:focus, 
 
.communicate-icon:active { 
 
    -webkit-transform: scale(1.2); 
 
    transform: scale(1.2); 
 
    -webkit-transition-timing-function: cubic-bezier(0.47, 2.02, 0.31, -0.36); 
 
    transition-timing-function: cubic-bezier(0.47, 2.02, 0.31, -0.36); 
 
    color: grey; 
 
    cursor: pointer; 
 
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.1/css/font-awesome.min.css" rel="stylesheet"/> 
 

 
<div id="east-exit"> 
 
    <a><i class="communicate-icon fa fa-envelope"></i></a> 
 
    <a><i class="communicate-icon fa fa-comments"></i></a> 
 
    <i class="east-exit-icon fa fa-arrow-right"></i> 
 
    <a><i class="communicate-icon fa fa-phone"></i></a> 
 
    <a><i class="communicate-icon fa fa-camera"></i></a> 
 
</div>

+0

謝謝!這怎麼不影響其他瀏覽器? – Mayia

+0

這是個好問題,我的朋友。不幸的是,我不知道確切的原因。 –