jQuery實現(xiàn)手風琴小案例_第1頁
jQuery實現(xiàn)手風琴小案例_第2頁
jQuery實現(xiàn)手風琴小案例_第3頁
jQuery實現(xiàn)手風琴小案例_第4頁
jQuery實現(xiàn)手風琴小案例_第5頁
全文預覽已結束

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內(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. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論