首页 技术 正文
技术 2022年11月7日
0 收藏 808 点赞 789 浏览 2723 个字

今天要给大家分享一款基于jquery的手风琴图片展示效果。这款图片的展示效果鼠标经过前是灰色的,当鼠标经过时图片变大且变为彩色。效果图如下:

一款基于jquery的手风琴图片展示效果

在线预览   源码下载

实现的代码。

html代码:

 <div class="page-container">
<div class="flex-container">
<div class="country netherlands">
<div>
Netherlands</div>
</div>
<div class="country belgium">
<div>
Belgium</div>
</div>
<div class="country france">
<div>
France</div>
</div>
<div class="country germany">
<div>
Germany</div>
</div>
<div class="country england">
<div>
England</div>
</div>
</div>
</div>
<script src='jquery.js'></script>
<script>
$('.country').click(function () {
$(this).toggleClass('active');
$('.page-container').toggleClass('opened');
}); //@ sourceURL=pen.js
</script>

css代码:

  div
{
-moz-box-sizing: border-box;
box-sizing: border-box;
} html, body, .page-container
{
height: 100%;
overflow: hidden;
} .page-container
{
-webkit-transition: padding 0.2s ease-in;
transition: padding 0.2s ease-in;
padding: 80px;
}
.page-container.opened
{
padding:;
}
.page-container.opened .flex-container .country:not(.active)
{
opacity:;
-webkit-flex:;
-ms-flex:;
flex:;
}
.page-container.opened .flex-container .country:not(.active) div
{
opacity:;
}
.page-container.opened .flex-container .active:after
{
-webkit-filter: grayscale(0%) !important;
filter: grayscale(0%) !important;
} .flex-container
{
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
height: 100%;
}
@media all and (max-width: 900px)
{
.flex-container
{
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
}
} .country
{
position: relative;
-webkit-flex-grow:;
-ms-flex-positive:;
flex-grow:;
-webkit-flex:;
-ms-flex:;
flex:;
-webkit-transition: 0.5s ease-in-out;
transition: 0.5s ease-in-out;
cursor: pointer;
font-family: "Bree Serif" , serif;
text-align: center;
color: #fff;
font-size: 22px;
text-shadow: 0 0 3px #000;
}
.country div
{
position: absolute;
width: 100%;
z-index:;
top: 50%;
text-align: center;
-webkit-transition: 0.1s;
transition: 0.1s;
-webkit-transform: translateY(-50%);
-ms-transform: translateY(-50%);
transform: translateY(-50%);
-webkit-filter: none;
filter: none;
}
.country:after
{
content: " ";
position: absolute;
top:;
left:;
right:;
bottom:;
background-size: cover;
-webkit-transition: 0.5s ease-in-out;
transition: 0.5s ease-in-out;
-webkit-filter: grayscale(100%);
filter: grayscale(100%);
}
.country:hover
{
-webkit-flex-grow:;
-ms-flex-positive:;
flex-grow:;
}
.country:hover:after
{
-webkit-filter: grayscale(0%);
filter: grayscale(0%);
}
@media all and (max-width: 900px)
{
.country
{
height: auto;
}
} .netherlands:after
{
background-image: url("Netherlands.png");
background-position: center;
} .belgium:after
{
background-image: url("belgium-307_3.jpg");
background-position: center;
} .france:after
{
background-image: url("30.jpg");
background-position: center;
} .germany:after
{
background-image: url("vacation.jpg");
background-position: center;
} .england:after
{
background-image: url("england.jpg");
background-position: center;
}

注:本文爱编程原创文章,转载请注明原文地址:http://www.w2bc.com/Article/9889

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,488
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,903
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,737
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,489
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:8,128
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:5,290