webkit transform blocking link

前端 未结 2 1959
耶瑟儿~
耶瑟儿~ 2020-12-03 04:06

I\'ve been working with transforms and transitions to create animated UI components without Javascript and really enjoying the results, but I\'ve come across a disturbing is

相关标签:
2条回答
  • 2020-12-03 04:11

    After combing through the webkit Bugzilla, I found someone who had the same issue and found a workaround.

    .face.back {
        background-color: #125672;
        -moz-transform: rotateY(180deg);
        -webkit-transform: rotateY(180deg);
    }
    

    Becomes:

    .face.back {
        background-color: #125672;
        -moz-transform: rotateY(180deg);
        -webkit-transform: rotateY(180deg) translateZ(1px);
    }
    

    The addition of the translateZ to the transform makes the left side of the element clickable.

    Here is a link to the bug: https://bugs.webkit.org/show_bug.cgi?id=54371

    0 讨论(0)
  • 2020-12-03 04:29

    I used this code below

    <style>    
    .outer div {
            float: left;
            -webkit-perspective: 200px;
            -webkit-transform-style: preserve-3d;
        }
    .outer a {
            -webkit-transition: all 1.0s ease-in-out;
            background:#0F6;
            width:100px;
            height:100px;
            display:block;
            -webkit-transform: rotateY(45deg);
        }
    .outer div:hover a {
            -webkit-transform: none;
        }
    </style>
    
    <div class="outer">
        <div>
            <a href="http://www.google.com/"></a>
        </div>
    </div>
    

    This solution works for me in chrome. http://jsfiddle.net/jaxweb/7qtLD/7/

    0 讨论(0)
提交回复
热议问题