61,112
社区成员
发帖
与我相关
我的任务
分享
!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>广告隐藏显示</title>
<script type="text/javascript" src="js/jquery-3.4.1.min.js"></script>
<style type="text/css">
#content{
width: 100%;
height: 600px;
background-color: antiquewhite;
}
</style>
<script type="text/javascript">
function adShow() {
$("#ad").show("slow");
}
function adHide() {
$("#ad").hide("slow")
}
$(function () {
setTimeout(adShow,2000);
setTimeout(adHide,6000)
})
</script>
</head>
<body>
<div>
<div id="ad" style="display: none;">
<img src="img/timg.jpg">
</div>
<div id="content">
正文部分
</div>
</div>
</body>
</html>