下載本文檔
版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領
文檔簡介
第jQuery實現(xiàn)手風琴小案例本文實例為大家分享了jQuery實現(xiàn)手風琴的具體代碼,供大家參考,具體內(nèi)容如下
代碼演示效果:
1.運用jQuery,動畫樣式進行輪播圖切換
2.前提,需要引入animate.css(官網(wǎng)下載就有)
HTML代碼:
head
metacharset="UTF-8"
title手風琴/title
linkrel="stylesheet"href="../animate.css"
linkrel="stylesheet"href="css/index.css"
scriptsrc="../jquery-3.1.0.js"/script
!--scriptsrc="js/手風琴index.js"/script--
/head
body
div/div
div/div
div/div
div/div
div
lidivp穿越火線/p/div/li
lidivp王者榮耀/p/div/li
lidivp使命召喚/p/div/li
lidivp英雄聯(lián)盟/p/div/li
/ul
/div
/body
script代碼:
script
$(function(){
$("li").mouseenter(function(){
//stop()阻止動畫效果
$(this).stop().animate({width:"700px"},1000,"linear").fadeIn();
$(this).siblings("li").stop().animate({width:"100px"},1000,"linear").fadeIn();
$(".bg").eq($(this).index()).siblings(".bg").stop().fadeOut();
$(".bg").eq($(this).index()).stop().animate({top:"700px"},400,"linear").fadeIn();
});
/script
css代碼:
margin:0;
padding:0;
html,body,.bg{
height:700px;
width:1400px;
overflow:hidden;
body{
position:relative;
display:none;
.bg:nth-child(1){
background:url("../images/1.jpg")no-repeatcenter/cover;
.bg:nth-child(2){
background:url("../images/2.jpg")no-repeatcenter/cover;
.bg:nth-child(3){
background:url("../images/3.jpg")no-repeatcenter/cover;
.bg:nth-child(4){
background:url("../images/4.jpg")no-repeatcenter/cover;
/*大背景顯示*/
.bg-active{
display:block;
.main{
position:absolute;
width:1000px;
height:400px;
/*background-color:pink;*/
left:0;
top:0;
right:0;
bottom:0;
margin:auto;
.mainul{
list-style:none;
.mainulli{
float:left;
width:100px;
height:400px;
transition:right1s;
/*小背景顯示*/
.mainulli.li-active{
width:700px;
height:400px;
.mainulli:nth-child(1){
background:url("../images/1.jpg")no-repeatcenter/cover;
.mainulli:nth-child(2){
background:url("../images/2.jpg")no-repeatcenter/cover;
.mainulli:nth-child(3){
background:url("../images/3.jpg")no-repeatcenter/cover;
.mainulli:nth-child(4){
background:url("../images/4.jpg")no-repeatcenter/cover;
.mainullidiv{
height:400px;
width:100px;
background-color:rgba(0,0,0,.5);
.main
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 生產(chǎn)科科長考試題及答案
- 生理學輸血試題及答案
- 瑞昌小學畢業(yè)考試題目及答案
- 輔警制度培訓課件
- 2026 年初中英語《語法填空》專項練習與答案 (100 題)
- 2026年深圳中考語文閱讀提分專項試卷(附答案可下載)
- 游戲題目及答案大全
- 2026年深圳中考數(shù)學中等生提分試卷(附答案可下載)
- 基本邏輯考題題庫及答案
- 2026年深圳中考歷史考場實戰(zhàn)模擬試卷(附答案可下載)
- 2025公文寫作考試真題及答案
- DB64∕T 1279-2025 鹽堿地綜合改良技術規(guī)程
- 2025年度耳鼻喉科工作總結及2026年工作計劃
- 2024年執(zhí)業(yè)藥師《藥學專業(yè)知識(一)》試題及答案
- 統(tǒng)編版語文一年級上冊無紙化考評-趣味樂考 玩轉語文 課件
- 高壓氧進修課件
- 2025年第三類醫(yī)療器械經(jīng)營企業(yè)質量管理自查報告
- 2025無人機物流配送網(wǎng)絡建設與運營效率提升研究報告
- 人工智能倫理規(guī)范
- 校園禁毒管理辦法
- 飼料供應循環(huán)管理辦法
評論
0/150
提交評論