

<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>图片颜色变换</title>
<style>
img {
max-width: 100%;
cursor: pointer;
transition: filter 0.3s;
}
</style>
<script src="../03.js/js文件.js"></script>
</head>
<body>
<img id="myImage" src="https://pic.wujinpp.com/upload/vod/20230601-1/35caef2be6ba3551c0abd5d07b33f2d7.jpg" alt="点击变色" />
<script>
$(document).ready(function() {
let isColorChanged = false;
$('#myImage').click(function() {
if (isColorChanged) { https://pic.wujinpp.com/upload/vod/20230601-1/35caef2be6ba3551c0abd5d07b33f2d7.jpg
$(this).css('filter', 'none');
} else {
$(this).css('filter', 'sepia(100%)');
}
isColorChanged = !isColorChanged;
});
});
</script>
</body>
</html>