用jQuery实现淡入淡出的弹窗小广告
代码如下:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
*{
margin: 0;
padding: 0;
}
.gg{
position: fixed;
right: 0;
bottom: 0;
border-radius: 4px;
overflow: hidden;
display: none;
border: 1px solid orange;
}
.gg>span{
display: inline-block;
width: 20px;
height: 20px;
background-size: 20px;
background-image: url(./image/叉.png);
position: absolute;
top: 2px;
right: 2px;
}
</style>
<script src="js/jquery.js"></script>
<script>
$(function (){
$(".gg>span").click(function (){
$(".gg").remove();
})
$(".gg").slideDown(1000).fadeOut(1000).fadeIn(1000);
});
</script>
</head>
<body>
<div class="gg">
<img src="image/5.png" width="300px" height="200px">
<span></span>
</div>
</body>
</html>
效果如下:

