但是我有一个问题一直没搞清楚,将这个代码写在一个页面中时,一直提示Cannot read property ‘top’ of undefined,我百度了一些原因但还是没有解决
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<link rel="stylesheet" href="悬浮/css/reset.min.css">
<style>
.ddd {
width: 100%;
height: 3500px;
}
.box {
width: 600px;
}
#videoBox {
border: 10px solid #212223;
transition: 0.5s;
}
video {
width: 100%;
vertical-align: bottom;
}
#videoBox.in {
animation: ac 1s;
}
#videoBox.out {
position: fixed;
bottom: 0;
right: 0;
width: 300px;
z-index: 999;
animation: an 0.5s;
}
</style>
</head>
<body>
<div id="site">
<div id="videoBox" class="box"&