代码语言:javascript复制
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style type="text/css">
*{margin: 0;padding: 0;list-style: none;}
div{width: 200px;height: 200px;background: black;position: absolute;left: 50%;top: 50%;margin: -100px 0 0 -100px;
transition:.3s;
-transform-origin:right top;
transform-origin:left center;
}
</style>
</head>
<body>
<div id="div1"></div>
<script type="text/javascript">
var reg=0;
setInterval(function()
{
reg ;
div1.style.transform="perspective(50px) rotateY(" reg "deg)";
},0);
</script>
</body>
</html>
代码语言:javascript复制<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style type="text/css">
*{margin: 0;padding: 0;list-style: none;}
div{
width: 100px;height: 100px;background: black;
}
</style>
</head>
<body>
<div id='div1'></div>
<script type="text/javascript">
/*addEventListener("load",function()
{
alert(1);
},false);
addEventListener("load",function()
{
alert(2);
},false);
*/
/*function show()
{
alert(1);
div1.removeEventListener("click",show);
}
div1.addEventListener("click",show,false);
*/
</script>
</body>
</html>