当前位置:网站首页>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>
边栏推荐
- UE4解决WebBrowser无法播放H.264的问题
- 虚函数
- Mosaic the face part of the picture
- [untitled]
- Stage 1 Review
- IP地址是什么
- NFT digital collection development: Jingdong "Qida bear takes you to the capital" tourism package
- Machine learning algorithm for large factory interview (5) recommendation system algorithm
- The user logs in continuously (interruption is allowed) to query SQL
- MySQL备份
猜你喜欢

查看真机APP里面沙盒文件

MySQL存储引擎

UItextview的textViewDidChange的使用技巧

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

Digital collection development / digital collection system development solution

10. I/o input / output stream

Entrepôt de données 4.0 Notes - acquisition de données sur le comportement de l'utilisateur II

NFT digital collection system development: Xu Beihong Art Museum unveiled through the digital collection platform

10、I/O 输入输出流

数仓4.0笔记——用户行为数据采集三
随机推荐
MySQL sorts by Chinese field initials
第一阶段复习
SQL realizes the user statistics of continuous login for more than 7 days
LearnOpenGL - Introduction
Data warehouse 4.0 notes - business data collection - sqoop
Digital collection development / meta universe digital collection development
[literature research] search PubMed for papers in journals with specific impact factors
NFT digital collection system development: the combination of music and NFT
9、 Practical class
Project instances used by activiti workflow
Implementation of neural network for face recognition
MySQL备份
NFT digital collection system development: Shenzhen Evening News "good times travel" digital collection online seconds chime
1. Know the database
[radiology] bugfix: when GLCM features: indexerror: arrays used as indexes must be of integer (or Boolean) type
Internet communication
ninja启动过程
3、DQL(数据查询语句)
数仓4.0笔记——业务数据采集
Cuda10.0 configuration pytorch1.7.0+monai0.9.0