收藏的星星,切换效果(jquery)

jq自己再找吧

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div class="img">
			<img src="img/c1.jpg" >
		</div>
	</body>
</html>

<script src="js/jquery.min.js"></script>
<script>
	$(".img").click(function(){
		if($('.img img').attr('src')=='img/c1.jpg'){
         $('.img img').attr('src','img/c2.jpg');
     }else{
         $('.img img').attr('src','img/c1.jpg');
     }
	})
</script>

  

 

posted @ 2020-07-21 10:58  野鹤亦闲云  阅读(219)  评论(0编辑  收藏  举报