JQuery实现动态漂浮广告&全局窗口
以下是效果图及实现代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>漂浮广告栏</title>
<script type="text/javascript" src="js/jquery-3.2.1.js"></script>
<style type="text/css">
body{
height: 100%;
width: 100%;
margin: 0;
padding: 0;
text-align: center;
}
#floatdiv{
width: 200px;
height: 200px;
position: absolute;
top: 0;
left: 0;
background-color: #fbb;
z-index: 999;
border: 1px solid #ccc;
border-radius: 10px 10px ;
}
span{
position: absolute;
top: 0;
right: 0;
color: darksalmon;
background-color: rgba(0, 0, 0, 0.5);
padding: 0 5px;
cursor: pointer;
border-radius: 20% 20%;
}
</style>
<