<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<style>
#div1{
width: 300px;
height: 200px;
background: black;
text-align: center;
line-height: 200px;
font-size: 50px;
position: absolute;
top: 300px;
left: 50%;
}
.active{
color: red;
}
</style>
<script>
var div1 = $('#div1');
setInterval(function(){
if (div1.hasClass('active'))
{
div1.removeClass('active')
}
else
{
div1.addClass('active')
}
},200);
</script>
<body>
<div id="div1">欢迎来到本网</div>
<script src="jquery-3.3.1.js"></script>
<script src="main.js"></script>
</body>
</html>
运用jquery制作的闪烁广告牌特效
最新推荐文章于 2021-06-04 10:13:15 发布