当前位置:网站首页>Accordion effect
Accordion effect
2022-07-23 11:56:00 【Zhou million】
Effect display :

html part :
<body>
<div class="container">
<ul>
<li>
<a href="#">
<img src="images/1.jpg" alt="" class="small">
<img src="images/1.jpg" alt="" class="big">
</a>
</li>
<li>
<a href="#">
<img src="images/2.jpg" alt="" class="small">
<img src="images/2.jpg" alt="" class="big">
</a>
</li>
<li>
<a href="#">
<img src="images/3.jpg" alt="" class="small">
<img src="images/3.jpg" alt="" class="big">
</a>
</li>
<li>
<a href="#">
<img src="images/4.jpg" alt="" class="small">
<img src="images/4.jpg" alt="" class="big">
</a>
</li>
<li>
<a href="#">
<img src="images/5.jpg" alt="" class="small">
<img src="images/5.jpg" alt="" class="big">
</a>
</li>
<li>
<a href="#">
<img src="images/6.jpg" alt="" class="small">
<img src="images/6.jpg" alt="" class="big">
</a>
</li>
</ul>
</div>
</body>css part :
<style>
* {
margin: 0;
padding: 0;
}
div {
box-sizing: border-box;
}
.container {
border-radius: 10px;
width: 490px;
height: 90px;
background-color: #eeeddd;
margin: 0 auto;
padding: 10px;
}
ul {
width: 700px;
}
ul li {
overflow: hidden;
position: relative;
list-style: none;
float: left;
width: 70px;
height: 70px;
margin-right: 10px;
}
ul li .small {
position: absolute;
top: 0;
left: 0;
width: 69px;
height: 69px;
border-radius: 5px;
}
ul li .big {
width: 224px;
display: none;
}
</style>JQuery part :
<script src="jquery.min.js"></script>
<script>
$(function() {
// When the mouse moves to ul Inside li Last time ,// li My brothers became 69px, Small pictures fade in , Big pictures fade out ( It's similar to exclusive thought )
$('ul li').mouseenter(function() {
// When the mouse enters '.container', Let his own width become 700px
$('.container').stop().animate({
width: 650
}, 1000);
// use animate() Method , Will the current li Change the width of to 224px
$(this).stop().animate({
width: 224
// Let small pictures '.small' Fade out , Big picture '.big' Fade in ,
}, 1000).find('.small').stop().fadeOut(1000).siblings('.big').stop().fadeIn(1000);
// At the same time, carry out an exclusive thought , Give Way li My brother has become a standard state ( It's similar to exclusive thought )
$(this).siblings().stop().animate({
width: 69
}, 1000).find('.small').stop().fadeIn(1000).siblings('.big').stop().fadeOut(1000);
// When the mouse goes away .container The box , be-all li All become standard});
$('.container').mouseleave(function() {
// When you leave, let '.container' Return to the original size
$('.container').stop().animate({
width: 490
}, 1000);
$('ul li').stop().animate({
width: 69
}, 1000).find('.small').stop().fadeIn(1000).siblings('.big').stop().fadeOut(1000);
})
})
</script>
边栏推荐
- NFT digital collection development: what are the possible application scenarios of digital collections in the future?
- ninja文件语法学习
- 11、多线程
- 3、DQL(数据查询语句)
- VMware uses wireless network card NAT to access the Internet under Windows
- [metric] use Prometheus to monitor flink1.13org.apache.flink.metrics
- Internet communication
- 抽象类和接口有什么区别?
- Data warehouse 4.0 notes - user behavior data collection II
- MySQL索引
猜你喜欢

数仓4.0笔记---用户行为数据生成

Data warehouse 4.0 notes - data warehouse environment construction - Yan configuration

數倉4.0筆記——業務數據采集

3. DQL (data query statement)

Project instances used by activiti workflow

ninja启动过程

NFT digital collection system development: Shenzhen Evening News "good times travel" digital collection online seconds chime

Cuda10.0 configuration pytorch1.7.0+monai0.9.0

NFT digital collection system development, development trend of Digital Collections

UE4解决WebBrowser无法播放H.264的问题
随机推荐
Entrepôt de données 4.0 Notes - acquisition de données commerciales
ChaosLibrary·UE4开坑笔记
Websocket long connection
Unable to negotiate with port 51732: no matching host key type found. Their offer:
BST树
[literature research] search PubMed for papers in journals with specific impact factors
求1~100之间不能被3整除的数之和
虚函数
Digital collection development / digital collection system development solution
SQL realizes the user statistics of continuous login for more than 7 days
数仓4.0笔记——数仓环境搭建—— Yarn配置
Installation and process creation of activiti app used by activiti workflow
数仓4.0笔记——用户行为数据采集三
3.1、对DQL简化补充
One of scala variables and data types
数仓4.0笔记——用户行为数据采集一
11. Multithreading
1. Know the database
IP地址是什么
ninja启动过程