首页 > Web开发 > 详细

CSS3知识点总结---transitionend

时间:2017-01-24 12:21:17      阅读:244      评论:0      收藏:0      [点我收藏+]

Webkit内核:

     obj.addEventListener(‘webkitTransitionEnd‘,function(){},false);

firefox:

    obj.addEventListener(‘transitionend‘,function(){},

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<style>
    .box{width:100px;height:100px;background:red;transition:1s width,2s 1s height,3s 3s background;}
    
</style>
<body>
    <div id="box" class="box">
        
    </div>
    <script>
        var box = document.getElementById("box");
        box.onclick= function(){
            this.style.width = this.offsetWidth + 100 + "px";
        }

        

        function addEnd(obj,fn){
            obj.addEventListener("webkitTransitionEnd",fn,false)
            obj.addEventListener("transitionend",fn,false)
        }

        addEnd(box,function(){
            alert("end");
        })
    </script>
</body>

</html>

 

false);

CSS3知识点总结---transitionend

原文:http://www.cnblogs.com/ldmblog/p/6346711.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!