基于jquery的手風(fēng)琴圖片展示效果實(shí)現(xiàn)方法
本文實(shí)例講述了基于jquery的手風(fēng)琴圖片展示效果實(shí)現(xiàn)方法。分享給大家供大家參考。具體實(shí)現(xiàn)方法如下:
代碼運(yùn)行效果如下圖所示:

index.html頁面代碼如下:
<!DOCTYPE html>
<html class=''>
<head>
<title>一款基于jquery的手風(fēng)琴圖片展示效果demo</title>
<style class="cp-pen-styles">
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: 0;
}
.page-container.opened .flex-container .country:not(.active)
{
opacity: 0;
-webkit-flex: 0;
-ms-flex: 0;
flex: 0;
}
.page-container.opened .flex-container .country:not(.active) div
{
opacity: 0;
}
.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: 1;
-ms-flex-positive: 1;
flex-grow: 1;
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
-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: 10;
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: 0;
left: 0;
right: 0;
bottom: 0;
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: 6;
-ms-flex-positive: 6;
flex-grow: 6;
}
.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;
}
</style>
</head>
<body>
<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>
</body>
</html>
完整實(shí)例代碼點(diǎn)擊此處本站下載。
希望本文所述對(duì)大家的jQuery特效設(shè)計(jì)有所幫助。
- jquery插件制作 手風(fēng)琴Panel效果實(shí)現(xiàn)
- jQuery制作效果超棒的手風(fēng)琴折疊菜單
- 基于Jquery代碼實(shí)現(xiàn)手風(fēng)琴菜單
- 基于jquery的slideDown和slideUp做手風(fēng)琴
- jquery手風(fēng)琴特效插件
- jquery超簡單實(shí)現(xiàn)手風(fēng)琴效果的方法
- Jquery組件easyUi實(shí)現(xiàn)手風(fēng)琴(折疊面板)示例
- 基于JQuery的一句話搞定手風(fēng)琴菜單
- 精心挑選的12款優(yōu)秀的基于jQuery的手風(fēng)琴效果插件和教程
- 讓人印象深刻的10個(gè)jQuery手風(fēng)琴效果應(yīng)用
- jQuery實(shí)現(xiàn)的簡單手風(fēng)琴效果示例
相關(guān)文章
jQuery實(shí)現(xiàn)獲取table表格第一列值的方法
這篇文章主要介紹了jQuery實(shí)現(xiàn)獲取table表格第一列值的方法,涉及jQuery針對(duì)table表格元素的遍歷與讀取相關(guān)技巧,需要的朋友可以參考下2016-03-03
jQuery使用一個(gè)按鈕控制圖片的伸縮實(shí)現(xiàn)思路
上一篇講解了jquery同時(shí)控制四張圖片的伸縮,想必大家對(duì)伸縮有一定了解了,本文將為大家介紹下使用按鈕控制圖片的伸縮,感興趣的朋友可以參考下哈2013-04-04
jQuery插件expander實(shí)現(xiàn)圖片翻轉(zhuǎn)特效
本文給大家分享的是一款基于jQuery插件expander實(shí)現(xiàn)圖片翻轉(zhuǎn)特效,一共有6種不同的圖片翻轉(zhuǎn)樣式,十分的炫酷,有需要的小伙伴可以參考下。2015-05-05
jquery實(shí)現(xiàn)隱藏與顯示動(dòng)畫效果/輸入框字符動(dòng)態(tài)遞減/導(dǎo)航按鈕切換
jquery實(shí)現(xiàn)隱藏顯示層動(dòng)畫效果、仿新浪字符動(dòng)態(tài)輸入、tab效果等等,以下為所有代碼,感興趣的朋友可以練練手哈,希望對(duì)大家學(xué)習(xí)有所幫助2013-07-07
基于jquery實(shí)現(xiàn)即時(shí)檢查格式是否正確的表單
這篇文章主要為大家詳細(xì)介紹了基于jquery實(shí)現(xiàn)即時(shí)檢查格式是否正確的表單具體代碼,感興趣的小伙伴們可以參考一下2016-05-05
關(guān)于jquery append() html時(shí)的小問題的解決方法
關(guān)于jquery append() html時(shí)的小問題,碰到類似問題的朋友可以參考下。2010-12-12
如何使用jquery easyui創(chuàng)建標(biāo)簽組件
這篇文章主要介紹了如何使用jquery easyui創(chuàng)建標(biāo)簽組件的相關(guān)資料,需要的朋友可以參考下2015-11-11

