Не удаётся подключить плагин JQ
Привет всем! Пытаюсь подключить плагин jq easing, чтобы модифицировать функцию slideToggle. Сделал, как указано на странице. Но сыплет ошибки. Подскажите, что не так. Вот подключение:
http://skrinshoter.ru/s/110419/ejxLff77 Сам скрипт: $(function(){ $('.ask').on('click', function(){ if($(this).next().css('display') === 'block') { return; } $('.answer').slideUp(500); $(this).next().slideDown({ duration: 500, easing: 'bouncein' }); }); }); Вот сам плагин: /* * jQuery Easing Compatibility v1 - [url]http://gsgd.co.uk/sandbox/jquery.easing.php[/url] * * Adds compatibility for applications that use the pre 1.2 easing names * * Copyright (c) 2007 George Smith * Licensed under the MIT License: * [url]http://www.opensource.org/licenses/mit-license.php[/url] */ jQuery.extend( jQuery.easing, { easeIn: function (x, t, b, c, d) { return jQuery.easing.easeInQuad(x, t, b, c, d); }, easeOut: function (x, t, b, c, d) { return jQuery.easing.easeOutQuad(x, t, b, c, d); }, easeInOut: function (x, t, b, c, d) { return jQuery.easing.easeInOutQuad(x, t, b, c, d); }, expoin: function(x, t, b, c, d) { return jQuery.easing.easeInExpo(x, t, b, c, d); }, expoout: function(x, t, b, c, d) { return jQuery.easing.easeOutExpo(x, t, b, c, d); }, expoinout: function(x, t, b, c, d) { return jQuery.easing.easeInOutExpo(x, t, b, c, d); }, bouncein: function(x, t, b, c, d) { return jQuery.easing.easeInBounce(x, t, b, c, d); }, bounceout: function(x, t, b, c, d) { return jQuery.easing.easeOutBounce(x, t, b, c, d); }, bounceinout: function(x, t, b, c, d) { return jQuery.easing.easeInOutBounce(x, t, b, c, d); }, elasin: function(x, t, b, c, d) { return jQuery.easing.easeInElastic(x, t, b, c, d); }, elasout: function(x, t, b, c, d) { return jQuery.easing.easeOutElastic(x, t, b, c, d); }, elasinout: function(x, t, b, c, d) { return jQuery.easing.easeInOutElastic(x, t, b, c, d); }, backin: function(x, t, b, c, d) { return jQuery.easing.easeInBack(x, t, b, c, d); }, backout: function(x, t, b, c, d) { return jQuery.easing.easeOutBack(x, t, b, c, d); }, backinout: function(x, t, b, c, d) { return jQuery.easing.easeInOutBack(x, t, b, c, d); } }); А вот ошибки: http://skrinshoter.ru/s/110419/7gqtmz7i |
Alessio18911,
до плагина это добавьте ( function() { // Based on easing equations from Robert Penner ([url]http://www.robertpenner.com/easing[/url]) var baseEasings = {}; $.each( [ "Quad", "Cubic", "Quart", "Quint", "Expo" ], function( i, name ) { baseEasings[ name ] = function( p ) { return Math.pow( p, i + 2 ); }; } ); $.extend( baseEasings, { Sine: function( p ) { return 1 - Math.cos( p * Math.PI / 2 ); }, Circ: function( p ) { return 1 - Math.sqrt( 1 - p * p ); }, Elastic: function( p ) { return p === 0 || p === 1 ? p : -Math.pow( 2, 8 * ( p - 1 ) ) * Math.sin( ( ( p - 1 ) * 80 - 7.5 ) * Math.PI / 15 ); }, Back: function( p ) { return p * p * ( 3 * p - 2 ); }, Bounce: function( p ) { var pow2, bounce = 4; while ( p < ( ( pow2 = Math.pow( 2, --bounce ) ) - 1 ) / 11 ) {} return 1 / Math.pow( 4, 3 - bounce ) - 7.5625 * Math.pow( ( pow2 * 3 - 2 ) / 22 - p, 2 ); } } ); $.each( baseEasings, function( name, easeIn ) { $.easing[ "easeIn" + name ] = easeIn; $.easing[ "easeOut" + name ] = function( p ) { return 1 - easeIn( 1 - p ); }; $.easing[ "easeInOut" + name ] = function( p ) { return p < 0.5 ? easeIn( p * 2 ) / 2 : 1 - easeIn( p * -2 + 2 ) / 2; }; } ); } )(); |
Ого!! Спасибо!:)
|
Часовой пояс GMT +3, время: 13:44. |