0

Safari で画像の境界線の半径に対して CSS3 の簡単なトランジションが機能するようにしようとしています。

スムーズな移行ではなく、ホバー状態に点滅するだけです。どんな助けでも大歓迎です

コード:

<style>
.all a:hover img {
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    border-radius: 50%;
    -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
    filter: alpha(opacity=100);
    -moz-opacity:1;
    -khtml-opacity: 1;
    opacity: 1;
    -webkit-filter: grayscale(0%);
}
.all a img {
    -webkit-border-radius: 3px;
    -moz-border-radius: 3px;
    border-radius: 3px;
    width: 50%;
    -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
    filter: alpha(opacity=90);
    -moz-opacity:0.9;
    -khtml-opacity: 0.9;
    opacity: 0.9;
}
.all a img {
    -moz-transition: all .3s ease;
    -webkit-transition: all .3s ease;
    -o-transition: all .3s ease;
    transition: all .3s ease;
}
.all a img {
    -webkit-filter: grayscale(100%);
    transition: border-radius .3s ease;
    -moz-transition: -moz-border-radius .3s ease,border-radius .3s ease;
    -webkit-transition: -webkit-border-radius .3s ease,border-radius .3s ease;

}
</style>

<ul class="thumbs">
    <li class="all identity">
        <a href="projects/project_identity/index.html"><img src="http://imjoeybrennan.com/images/logos_t.jpg" alt="Logos"/></a>
    </li>
</ul>

サイトへのリンク: http://imjoeybrennan.com

4

2 に答える 2

3

以下は、境界線の半径が適用された親要素に適用され、webkit をキックして線に戻します。

-webkit-mask-image: -webkit-radial-gradient(white, black);

もう 1 つのオプションは、2 つの境界半径の親で要素をラップすることです。

私にはハックに思えますが、二重ラップオプションよりもはるかに優れています.他の解決策を聞くことに興味があります.

于 2013-11-18T00:15:46.293 に答える
2

これは簡単な修正です。Safari はピクセルからパーセンテージへの移行をサポートしていません。ホバー スタイルを 50% から 100px に変更すると、トランジションがスムーズに機能することがわかります。

.all a:hover img {
    -webkit-border-radius: 100px;
    -moz-border-radius: 100px
    border-radius: 100px;

}

ホバーしたときに常に丸くなるように、画像の高さと幅の 2 倍の値に設定することをお勧めします。

于 2012-11-20T15:36:11.013 に答える