1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Redefine XenForo animation functions

Discussion in 'XenForo Development Discussions' started by CyberAP, Apr 8, 2014.

  1. CyberAP

    CyberAP Well-Known Member

    I was trying to change XenForo animation behaviour but got myself stuck at that high abstraction level. In xenforo.js we have jQuery.fn.extend function and within it also all our animating functions:
    • xfFadeDown
    • xfFadeUp
    • xfInsert
    • xfRemove
    • _xfSlideWrapper
    • xfSlideIn
    • xfSlideOut
    And also two effects:
    • slideDownContentFade
    • slideDown
    So how should I call them in case I want to overwrite their behaviour?
     
  2. CyberAP

    CyberAP Well-Known Member

    Figured this out. I just have to overwrite functions using exactly the same code.
    So it'll look like this:
    Code:
    !function($, window, document, _undefined)
    {
        jQuery.fn.extend(
        {
            xfSlideOut: function(duration, easing, callback)
            {
                …
            }
        });
    }(jQuery, this, document);
     

Share This Page