jQuery相册关灯模式(光线聚焦于鼠标悬停位置)_代码练习

版权声明:本文为博主(http://www.leologic.top/)原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_17107171/article/details/83586131
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style>
			*{
				margin: 0px;
				padding: 0px;
			}
			body{
				width: 1300px;
			}
			table{
				margin: 50px auto;
			}
			.background{
				background: #0D0D0D; /*背景设为黑色*/
			}
			.light-off{
			    opacity: 0.3;transition: all 1s ease 0s;
			}
			    
		</style>
	</head>
	<body class="background">
		<table>
			<tr>
				<td class="light-off"><img src="img/01.jpg"/></td>
				<td class="light-off"><img src="img/02.jpg"></td>
				<td class="light-off"><img src="img/03.jpg"></td>
			</tr>
			<tr>
				<td class="light-off"><img src="img/04.jpg" /></td>
				<td class="light-off"><img src="img/05.jpg" /></td>
				<td class="light-off"><img src="img/06.jpg"></td>
			</tr>
		</table>
	</body>
	<script  src="http://libs.baidu.com/jquery/1.7.2/jquery.min.js"></script>
	<script>  
    $("td").hover(function(){
    	$(this).css("opacity","1");
    	$(this).css("transition","all 1s ease 0s");
	},function(){
	    $(this).css("opacity","0.3");
    	$(this).css("transition","all 1s ease 0s");
	});
	</script>
</html>

猜你喜欢

转载自blog.csdn.net/qq_17107171/article/details/83586131