<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>:animated</title>
<style>
div {
width:300px;
height:300px;
background-color: lightgreen;
}
</style>
</head>
<script src="jquery-3.1.1.js">
</script>
<body>
<!--:animated 匹配所有正在执行动画效果的元素-->
<button id="run">Run</button>
<div></div>
</body>
<script type="text/javascript">
$('#run').click(function(){
$("div:not(:animated)").animate({ width: "+=30" }, 5000);
});
</script>
</html>
jQquery :animated 给没有动画效果的元素添加动画
最新推荐文章于 2022-05-19 08:46:53 发布