animate.css就是一個(gè)動(dòng)畫(huà)庫(kù),使用時(shí)注意點(diǎn):
用法:
<head> <link rel="stylesheet" href="animate.min.css"> </head> <h1 class="animated bounceOut">Animate.css</h1>當(dāng)與jQuery結(jié)合起來(lái),你可以自己決定何時(shí)啟用這些動(dòng)畫(huà),通過(guò)jQuery動(dòng)態(tài)添加使用動(dòng)畫(huà):
$('#yourElement').addClass('animated bounceOutLeft');可以檢測(cè)動(dòng)畫(huà)結(jié)束事件:
$('#yourElement').one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', doSomething);:jQuery.one() 最多執(zhí)行事件處理一次。
您可以更改動(dòng)畫(huà)的持續(xù)時(shí)間,增加延遲或改變顯示次數(shù):
#yourElement { -vendor-animation-duration: 3s; -vendor-animation-delay: 2s; -vendor-animation-iteration-count: infinite; }
*注意:一定要在CSS適當(dāng)?shù)那熬Y(webkit, moz等)代替“vendor”
fullpage的afterLoad方法中注意點(diǎn):
- anchorLink和index分別是錨鏈接名稱(section)和 序號(hào)(對(duì)應(yīng)錨鏈接)。
- 利用if語(yǔ)句判斷頁(yè)面錨鏈接的序號(hào)。
- 使用addClass改變標(biāo)簽屬性,將標(biāo)簽屬性改為所需要的動(dòng)畫(huà)(注:每一頁(yè)(section)的動(dòng)畫(huà)必須寫(xiě)在相對(duì)應(yīng)的if語(yǔ)句中)。
- 需要有動(dòng)畫(huà)的標(biāo)簽除了第一頁(yè)(section),都需要設(shè)置隱藏屬性display:none;否則所有的section會(huì)同時(shí)執(zhí)行動(dòng)畫(huà),導(dǎo)致其他頁(yè)面動(dòng)畫(huà)提前執(zhí)行。
- 在相對(duì)應(yīng)的if中使用show方法使其顯示。
相關(guān)鏈接:
jQuery全屏滾動(dòng)插件FullPage.js中文幫助文檔API:http://www.uedsc.com/fullpage.html
動(dòng)畫(huà)demo以及資料訪問(wèn)地址:vss上面 \99.Study\demo and package.rar