<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<style type="text/css">
* {
padding: 0;
margin: 0;
}
body {
background-color: rgba(0, 0, 0, 0.5);
}
#change {
position: relative;
width: 500px;
height: 280px;
margin: 100px auto;
overflow: hidden;
transition: 0.5s;
}
.span {
display: block;
width: 500px;
height: 280px;
position: absolute;
transform: scale(1.5);
transition: 0.6s;
left: 0;
top: 0;
z-index: -999;
background-image: url(img/2.jpg);
background-repeat: no-repeat;
}
#change:hover .span {
transform: scale(1);
}
#change ul {
list-style: none;
font-size: 0;
}
#change ul li {
width: 250px;
height: 140px;
background-image: url(img/1.jpg);
background-repeat: no-repeat;
transition: 0.5s;
}
#change ul li:nth-child(1) {
background-position-x: 0;
background-position-y: 0;
}
#change ul li:nth-child(2) {
background-position-x: -250px;
background-position-y: 0;
position: absolute;
left: 250px;
top: 0;
}
#change ul li:nth-child(3) {
background-position-x: 0;
background-position-y: -140px;
}
#change ul li:nth-child(4) {
background-position-x: -250px;
background-position-y: -140px;
position: absolute;
left: 250px;
top: 140px;
}
#change:hover ul li:nth-child(1) {
background-position-y: 140px;
}
#change:hover ul li:nth-child(2) {
background-position-x: -500px;
}
#change:hover ul li:nth-child(3) {
background-position-x: 250px;
}
#change:hover ul li:nth-child(4) {
background-position-y: -280px;
}
</style>
</head>
<body>
<div id="change">
<ul>
<li></li>
<li></li>
<li></li>
<li></li>
<span class="span"></span>
</ul>
</div>
<div style="text-align:center;margin:50px 0; font:normal 14px/24px 'MicroSoft YaHei';">
<p>适用浏览器:360、FireFox、Chrome、Opera、傲游、搜狗、世界之窗. 不支持Safari、IE8及以下浏览器。</p>
<p>更多源码:<a href="http://www.96flw.com/" target="_blank">www.96flw.com</a></p>
</div>
</body>
</html>
2张图片鼠标经过切片显示代码.zip
113 浏览量
2023-11-02
22:56:20
上传
评论
收藏 79KB ZIP 举报
码云笔记
- 粉丝: 2w+
- 资源: 5851
最新资源
- html+css+'青春献礼二十大 红色旅游助乡村'为主题的网页设计 2022年参与学校网页设计比赛时完成的
- Unity 模型布尔运算插件
- eCANtools工具,CAN资料包
- 129335283047061xiazaigongjuxiang(去重软件).apk
- Android环境检测工具,检测ksu,lsp,magisk等
- WordPress后台美化插件QuarterAdmin分享
- PCB_Project单片机绘制 (2024-5-11 22-22-13).zip
- nccl-local-repo-ubuntu2204-2.21.5-cuda12.4-1.0-1-amd64
- STM32移植LVGL源码工程 stm32移植GUI-Guider源码 LVGL移植源码
- Screenshot_20240522_084328_com.tencent.mm.jpg
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈