js代码
<script src="js/myFun.js" type="text/javascript" charset="utf-8"></script> <script type="text/javascript"> window.addEventListener('load',function(){ //获取事件源 var box = document.getElementById('box'); var close = document.getElementById('close'); var top = document.getElementById('top'); var bottom = document.getElementById('bottom'); //绑定事件 close.addEventListener('click',function(){ animation(bottom,{"height":0},function(){ animation(box,{"width":0},function(){ close.style.display = 'none'; }) }) }); }) </script>