White space around css3 scale

后端 未结 6 503
感情败类
感情败类 2020-11-27 16:35

I have a small issue I want to fix, but can\'t find any good answer :

When I use a scale on a div (which contains other divs), it leave white space around, from the

6条回答
  •  无人及你
    2020-11-27 17:28

    Another idea for white spaces when you transform objects

    transformme

    css

    .outer { overflow:hidden }
    .inner {
        transform-origin:left top;
    }
    

    js

    var rate = 0.5;
    var outerheight = $('.inner').outerHeight()*rate;
    $('.inner').css({ transform: "scale("+rate+")" });
    $('.outer').css({ height: outerheight });
    

    Also you can add other browser tags; -webkit-transform, -moz-transform, -o-transform

提交回复
热议问题