Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7986343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:49:51+00:00 2026-06-04T11:49:51+00:00

Delaying effect and adding durration is pretty clear with Fx.Morph or Fx.Tween but how

  • 0

Delaying effect and adding durration is pretty clear with Fx.Morph or Fx.Tween but how do I delay or add duration with method morph or tween ?

for example delay this by 3sec and set duration of 500

mouseleave: function() {
     el1.tween("margin-bottom","-280px");
     el.morph({'opacity': [0.2,1]});
}

any help is appreciated. Thank you!

EDITED: here is example http://jsfiddle.net/UungE/17/ the info has more lines because I am morphing another 4 elements inside info ( thus the try to shorten the code ) but I added just basics and I have it working just fine , but I want to achieve same result with info2 and less code. is it possible

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T11:49:52+00:00Added an answer on June 4, 2026 at 11:49 am

    this is a two part question.

    part 1

    special acessors for class instances that have an element prototype are available for mootools classes like fx.tween/morph as well as request, validator etc.

    el.set('tween', {
        duration: 500
    }).tween(something);
    

    set will either create an instance of Fx.Tween if none found – or setOptions() your new options into the existing instance.

    same applies to .get only it can return the actual Fx.something instance:

    var instance = el.get('morph', { duration: 600 });
    instance.start({marginBottom:[0,-280]});
    

    see what the custom set/get really do here: https://github.com/mootools/mootools-core/blob/master/Source/Fx/Fx.Tween.js#L45-61

    very useful for classes that are related to a single dom element as a pattern.

    part 2

    adding a delay is going to be simple.

    mouseleave: function() {
        clearTimeout(this.retrieve('handle')); // reset.
        this.store('handle' (function() {
            el1.tween(); ....
    
        }).delay(3000));
    
    }
    

    in case they leave and come back in the 3 secs, it will reset the timer.

    tidy up example with your fiddle:

    $$('.info').each(function(el) {
        el.set('morph', {
            duration: 300,
            'link': 'cancel'
        }).addEvents({
            mouseenter: function() {
                clearTimeout(this.retrieve('handle'));
                this.morph({
                    'margin-left': 70
                });
            },
            mouseleave: function() {
                 this.store('handle', (function() {
                    this.morph({
                        marginLeft: 0
                    });
                }).delay(500, this));
            }
        });
    });
    

    if you want less code in the setup, you can use something like this delay pseudo hook i wrote for hoverIntent – but also for any delayed event, really:
    http://jsfiddle.net/dimitar/xAJ5f/

    you can then do: mouseleave:delay(500): function() {}

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this problem is ancient, but I can't seem to find a clear
According to jQuery document on .delay() , The .delay() method is best for delaying
The trigger below is delaying my insert response. How can I prevent this? create
I have some problem with show and delay.. When I try add .delay to
I need to delaying the reloading of the page. Right now, I have this:
I'm rather new to serious programming, so please forgive my dumbness, but I've failed
I'm having some trouble understanding how the delay macro works in Clojure. It doesn't
i am adding data from vba excel using adodb into a mysql database everything
I need to run some code but only after the text-to-speech stops talking. I
I know that when the main method is running and the only other threads

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.