Okay
  Public Ticket #2512126
Remove TweenMax reference/calls
Closed

Comments

  • SunnysGlimpse started the conversation

    Hello. If we don't want the animations because we want to eliminate the use of TweenMax to lighten our Javascript load, how can we simplify calls like this?

    TweenMax.set($submenu, {css: props_from});

        TweenMax.to($submenu, options.submenu_open_delay, {css: props_to, ease: options.submenu_open_easing, onUpdate: ps_update, onComplete: function()
        {
            $submenu.attr('style', '');
        }});

        TweenMax.to($submenu, options.submenu_open_delay, {css: {height: 0, opacity: .2}, ease: options.submenu_open_easing, onUpdate: ps_update, onComplete: function()
        {
            $submenu.removeClass('visible');
        }});

    We are fine having no animations at all.

    Thank you!

  • [deleted] replied

    Hi SunnysGlimpse,

    To get rid of animation simply look for onComplete callback function and remove code starting from TweenMax.set to TweenMax.to so in your case this code:

    TweenMax.set($submenu, {css: props_from});
    TweenMax.to($submenu, options.submenu_open_delay, {css: props_to, ease: options.submenu_open_easing, onUpdate: ps_update, onComplete: function()
     {
       $submenu.attr('style', '');
     }});
    TweenMax.to($submenu, options.submenu_open_delay, {css: {height: 0, opacity: .2}, ease: options.submenu_open_easing, onUpdate: ps_update, onComplete: function()
     {
       $submenu.removeClass('visible'); 
     }});
    
    Would be:

    $submenu.removeClass('visible'); // or addClass depending on what you mean to do
    
    Does this help you?

  • SunnysGlimpse replied

    Thank you Arlind. I thought that may be the case, but just wanted to confirm so I don't run into any "unexpected" complications. It appears to work good.

    Last question, I believe "Sine" is also an object from Greensock.

    Will it be fine to just comment the easing line out from this call:

            submenu_options          = {
                submenu_open_delay: 0.25,
                //submenu_open_easing: Sine.easeInOut,
                submenu_opened_class: 'opened'
            },
            root_level_class       = 'root-level',
            is_multiopen           = public_vars.$mainMenu.hasClass('multiple-expanded');

    Thank you!


  • [deleted] replied

    Hello SunnysGlimpse,

    No worries, you can ask anything related to Neon I will be happy to help you.

    Removing the easing (Sine object) won't cause any issue, its just an addition to animation so feel free to comment it.