<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
#life{
width: 300px;
height: 100px;
background-color: saddlebrown;
padding-top: 20px;
display: inline-block;
}
.active{
color:red;
}
</style>
<script src="C:\Users\PC\Desktop\jquery-3.3.1.js"></script>
<script>
$(document).ready(function(){
$('.box').css({
width:'50px',
height:'50px',
background:'black',
border:'14px solid grey'
});
var life = $('#life');
function logging(){
if(life.hasClass('active')){
life.removeClass('active');
}else{
life.addClass('active');
}
}
setInterval(logging,500);
});
</script>
</head>
<body>
<div class="box"></div>
<div id="life">护肤品,二楼右转</div>
</body>
</html>
jquery--广告闪
最新推荐文章于 2024-06-19 21:34:23 发布