Jquery_jquery의 애니메이션에 더 많은 작업 효과 예제를 추가합니다.

WBOY
풀어 주다: 2016-05-16 17:23:22
원래의
1241명이 탐색했습니다.

코드 복사 코드는 다음과 같습니다.

//animation
jQuery.extend({
    easing:
    {        // ******* back
        backEaseIn: function (p, n, firstNum, diff) {
            var c = firstNum + diff;
            var s = 1.70158; // default overshoot value, can be adjusted to suit
            return c * (p /= 1) * p * ((s + 1) * p - s) + firstNum;
        },
        backEaseOut: function (p, n, firstNum, diff) {
            var c = firstNum + diff;
            var s = 1.70158; // default overshoot value, can be adjusted to suit
            return c * ((p = p / 1 - 1) * p * ((s + 1) * p + s) + 1) + firstNum;
        },
        backEaseInOut: function (p, n, firstNum, diff) {
            var c = firstNum + diff;
            var s = 1.70158; // default overshoot value, can be adjusted to suit
            if ((p /= 0.5) < 1)
                return c / 2 * (p * p * (((s *= (1.525)) + 1) * p - s)) + firstNum;
            else
                return c / 2 * ((p -= 2) * p * (((s *= (1.525)) + 1) * p + s) + 2) + firstNum;
        },
        // ******* bounce
        bounceEaseIn: function (p, n, firstNum, diff) {

            var c = firstNum + diff;
            var inv = this.bounceEaseOut(1 - p, 1, 0, diff);
            return c - inv + firstNum;
        },
        bounceEaseOut: function (p, n, firstNum, diff) {
            var c = firstNum + diff;

            if (p                return c * (7.5625 * p * p) firstNum;
           }
            else if (p                return c * (7.5625 * (p -= (1.5 / 2.75)) * p .75) firstNum;
           }
           else if (p < (2.5 / 2.75)) {
                반환 c * (7.5625 * (p -= (2.25 / 2.75)) * p .9375) firstNum;
            }
            else {
              return c * (7.5625 * (p -= (2.625 / 2 .75)) * p.984375) firstNum;
            }
        },
        // ******* circ
        circEaseIn: 함수 (p, n, firstNum, diff) {
            var c = firstNum diff;
            return -c * (Math.sqrt(1 - (p /= 1) * p) - 1) firstNum;
        },
        circEaseOut: 함수 (p, n, firstNum, diff) {
            var c = firstNum diff;
            return c * Math.sqrt(1 - (p = p / 1 - 1) * p) firstNum;
        },
        circEaseInOut: 함수( p, n, firstNum, diff) {
            var c = firstNum diff;
            if ((p /= 0.5) < 1)
                return -c / 2 * (Math.sqrt(1 - p * p) - 1) firstNum;
            else
               return c / 2 * (Math.sqrt(1 - (p -= 2) * p) 1) firstNum;
        },
        // ******* 큐빅
        큐빅EaseIn: function (p, n, firstNum, diff) {
            var c = firstNum diff;
            return c * (p /= 1) * p * p firstNum;
        },
        큐빅EaseOut: 함수 (p, n, firstNum, diff) {
            var c = firstNum diff;
            return c * ((p = p / 1 - 1) * p * p 1) firstNum;
        },
        큐빅EaseInOut: 함수 (p, n, firstNum, diff) {
            var c = firstNum diff;
            if ((p /= 0.5) < 1)
               return c / 2 * p * p * p firstNum;
           else
                c / 2 * 반환 (피 - = 2) * p * p 2) firstNum;
        },
        // ******* 탄력적
        elasticEaseIn: 함수 (p, n, firstNum, diff) {
            var c = firstNum diff;
            if (p == 0) return firstNum;
            if (p == 1) return c;
            var peroid = 0.25;
            var s;
           var 진폭 = c;
            if (진폭                 진폭 = c;
               s = peroid / 4;
           }
           else {
               s = / (2 * Math.PI) * Math.asin(c / 진폭 );
            }
            return -(amplitude * Math.pow(2, 10 * (p -= 1)) * Math.sin((p * 1 - s) * (2 * Math.PI) / peroid)) firstNum;
        },
        elasticEaseOut: 함수 (p, n, firstNum, diff) {
            var c = firstNum diff;
            if (p == 0) return firstNum;
            if (p == 1) return c;
            var peroid = 0.25;
            var s;
            var 진폭 = c;
            if (amplitude < 절대(c)) {
               진폭 = c;
               s = peroid / 4;
           }
            else {
                s = peroid / (2 * Math.PI) * Math.asin(c / 진폭);
            }
            return -(amplitude * Math.pow(2, -10 * p) * Math.sin((p * 1 - s) * (2 * Math.PI) / peroid)) c;
},
        // ******* expo
        expoEaseIn: 함수 (p, n, firstNum, diff) {
            var c = firstNum diff;
            return (p == 0) ? firstNum : c * Math.pow(2, 10 * (p - 1)) firstNum - c * 0.001;
        },
        expoEaseOut: 함수 (p, n, firstNum, diff) {
            var c = firstNum diff;
            return (p == 1) ? c : diff * 1.001 * (-Math.pow(2, -10 * p) 1) firstNum;
        },
        expoEaseInOut: 함수 (p, n, firstNum, diff) {
            var c = firstNum diff;
            if (p == 0) return firstNum;
            if (p == 1) return c;
            if ((p /= 0.5) < 1)
                return c / 2 * Math.pow(2, 10 * (p - 1)) firstNum - c * 0.0005;
            else
               return c / 2 * 1.0005 * (-Math.pow(2, -10 * --p ) 2) firstNum;
        },
        // ******* 쿼드
        쿼드EaseIn: 함수 (p, n, firstNum, diff) {
            var c = firstNum diff;
            return c * (p /= 1 ) * p firstNum;
        },
       quadEaseOut: 함수 (p, n, firstNum, diff) {
            var c = firstNum diff;
            return -c * (p /= 1) * ( p - 2) firstNum;
        },
        QuadEaseInOut: 함수 (p, n, firstNum, diff) {
            var c = firstNum diff;
            if ((p /= 0.5) < 1 )
               return c / 2 * p * p firstNum;
            else
               return -c / 2 * ((--p) * (p - 2) - 1) firstNum;
        },
        // ******* quart
        quartEaseIn: 함수 (p, n, firstNum, diff) {
            var c = firstNum diff;
            return c * (p /= 1) * p * p * p firstNum;
        },
        quartEaseOut: 함수 (p, n, firstNum, diff) {
            var c = firstNum diff;
            return -c * ((p = p / 1 - 1) * p * p * p - 1) firstNum;
        },
        quartEaseInOut: function (p, n, firstNum, diff) {
            var c = firstNum diff;
            if ( (p /= 0.5) < 1)
                return c / 2 * p * p * p * p firstNum;
            else
               return -c / 2 * ((p -= 2) * p * p * p - 2) firstNum;
        },
        // ******* quint
        quintEaseIn: function (p, n, firstNum, diff) {
            var c = firstNum diff;
            return c * ( p /= 1) * p * p * p * p firstNum;
        },
        quintEaseOut: function (p, n, firstNum, diff) {
            var c = firstNum diff;
            return c * ((p = p / 1 - 1) * p * p * p * p 1) firstNum;
        },
        quintEaseInOut: 함수 (p, n, firstNum, diff) {
            var c = firstNum diff;
            if ((p /= 0.5) < 1)
               return c / 2 * p * p * p * p * p firstNum;
           else
                c / 반환 2 * ( (p -= 2) * p * p * p * p 2) firstNum;
        },
        // *******  sine
        sineEaseIn: 함수 (p, n, firstNum, diff ) {
            var c = firstNum diff;
            return -c * Math.cos(p * (Math.PI / 2)) c firstNum;
        },
sineEaseOut: 함수(p, n, firstNum, diff) {
var c = firstNum diff;
sineEaseOut: 함수(p, n, firstNum, diff) return c * Math.sin(p * (Math.PI / 2)) firstNum;
                                     sineEaseInOut: 함수 (p, n, firstNum, diff) {                                   > >});


전화:



코드 복사

코드는 다음과 같습니다.$("#div ").animate({ 왼쪽: v}, 1000, "circEaseOut");
관련 라벨:
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿