开发者社区> 问答> 正文

css3图片抖动

我这个点击document弹出图片他会抖动,不知道是怎么回事?
要是把外层的sdf去了他又是正常的,要怎么改

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        .sdf{
            width:500px;
            height:500px;
            overflow:hidden;
            margin:200px auto;
            position:relative;
        }

       .outter{
            width:174px;
            height:155px;
            position:absolute;
            top:100px;
            left:200px;
            transition:all 1s ease;
       }
       .dd{
           background:url(http://www.ppt123.net/beijing/UploadFiles_8374/201203/2012032518062306.jpg);
            overflow:hidden;
            background-size:174px 155px;
            background-position:center center;
            transition:all 1s ease;
            width:0px;
            height:155px;
            margin:0 auto;
       }
    </style>
</head>
<body>
    <div class="sdf">
        <img class="lazy" src="http://img06.sephome.com/201602/D2D5B00588B8488496F37014622724F9.jpeg" data-original="http://img06.sephome.com/201602/D2D5B00588B8488496F37014622724F9.jpeg" width="100%" alt="" style="display: inline;">
        <div class="outter">
           <div class='dd'></div>
        </div>
    </div>
    <script src="http://cdn.bootcss.com/jquery/2.2.1/jquery.js"></script>
    <script>
        $(function() {

            $(document).on('click', function() {
               $(".dd").css({
                    'width':'174px'
               })
            });
            
        });
    </script>
</body>

展开
收起
小旋风柴进 2016-05-31 08:15:35 1985 0
0 条回答
写回答
取消 提交回答
问答分类:
问答标签:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
零基础CSS入门教程 立即下载
低代码开发师(初级)实战教程 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载