做過的動(dòng)畫記錄

1.下拉查看:

下拉查看

html:

? ? ? <div class="mouse-div">

? ? ? <img class="mouse" src="img/mouse.png"/>

? ? ? </div>

css:

.mouse-div{

width: 100%;

height: 0.26rem;

text-align: center;

cursor: pointer;

position: absolute;

left: 0;

bottom: 1rem;

}

.mouse{

width: 0.27rem;

-webkit-transform: perspective(1px) translateZ(0);

transform: perspective(1px) translateZ(0);

box-shadow: 0 0 1px rgba(0, 0, 0, 0);

-webkit-animation-name: hvr-bob-float, hvr-bob;

animation-name: hvr-bob-float, hvr-bob;

-webkit-animation-duration: .1s, 1s;

animation-duration: .1s, 1s;

-webkit-animation-delay: 0s, 0s;

animation-delay: 0s, 0s;

-webkit-animation-timing-function: ease-out, ease-in-out;

animation-timing-function: ease-out, ease-in-out;

-webkit-animation-iteration-count: 1, infinite;

animation-iteration-count: 1, infinite;

-webkit-animation-fill-mode: forwards;

animation-fill-mode: forwards;

-webkit-animation-direction: normal, alternate;

animation-direction: normal, alternate;

}

@-webkit-keyframes hvr-bob {

0% {

-webkit-transform: translateY(0px);

transform: translateY(0px);

}

50% {

-webkit-transform: translateY(-10px);

transform: translateY(-10px);

}

100% {

-webkit-transform: translateY(0px);

transform: translateY(0px);

}

}

@keyframes hvr-bob {

0% {

-webkit-transform: translateY(0px);

transform: translateY(0px);

}

50% {

-webkit-transform: translateY(-10px);

transform: translateY(-10px);

}

100% {

-webkit-transform: translateY(0px);

transform: translateY(0px);

}

}

@-webkit-keyframes hvr-bob-float {

100% {

-webkit-transform: translateY(0px);

transform: translateY(0px);

}

}

@keyframes hvr-bob-float {

100% {

-webkit-transform: translateY(0px);

transform: translateY(0px);

}

}


2.鼠標(biāo)滾動(dòng) 導(dǎo)航顯示與隱藏

windowAddMouseWheel();

function windowAddMouseWheel() {

var scrollFunc = function(e) {

e = e || window.event;

var Scrolltop = $(document).scrollTop();

console.log(Scrolltop)

if(e.wheelDelta) {?

if(Scrolltop == 900 || Scrolltop < 900) {

$('.nav').fadeOut()

}

if(Scrolltop > 900) {

$('.nav').fadeIn()

}

}

};

//給頁面綁定滑輪滾動(dòng)事件

if(document.addEventListener) {

document.addEventListener('DOMMouseScroll', scrollFunc, false);

}

//滾動(dòng)滑輪觸發(fā)scrollFunc方法

window.onmousewheel = document.onmousewheel = scrollFunc;

}

3.各種按鈕的動(dòng)畫css效果參考

頁面地址:http://www.youhutong.com/demo/00238yanshinfhmpwftcgnprsy/

hover css文件地址:http://www.youhutong.com/demo/00238yanshinfhmpwftcgnprsy/css/hover.css

使用時(shí)可以直接把css copy過來 比如:

.hvr-grow {

? display: inline-block;

? vertical-align: middle;

? -webkit-transform: translateZ(0);

? transform: translateZ(0);

? box-shadow: 0 0 1px rgba(0, 0, 0, 0);

? -webkit-backface-visibility: hidden;

? backface-visibility: hidden;

? -moz-osx-font-smoothing: grayscale;

? -webkit-transition-duration: 0.3s;

? transition-duration: 0.3s;

? -webkit-transition-property: transform;

? transition-property: transform;

}

.hvr-grow:hover, .hvr-grow:focus, .hvr-grow:active {

? -webkit-transform: scale(1.1);

? transform: scale(1.1);

}

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容