<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>链式动画</title> <style> * { margin: 0; padding: 0; } #odiv { width: 100px; height: 100px; background: pink; opacity: 0.5; } </style> </head> <body> <div id="odiv"> </div> <script type="text/javascript"> var odiv = document.getElementById("odiv"); //第三种 //执行动画的对象,目标值,动画的属性,下一个动画 odiv.onmouseover=function(){ starMove(odiv,500,'width',function(){ starMove(odiv,200,'height',function(){ starMove(odiv,100,'opacity',function(){ console.log("结束") }) }) }) }; odiv.onmouseout=function(){ starMove(odiv,50,'opacity',function(){ starMove(odiv,100,