Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing rotation speed for last few phrases #24

Open
smfoster3 opened this issue Feb 28, 2017 · 11 comments
Open

Changing rotation speed for last few phrases #24

smfoster3 opened this issue Feb 28, 2017 · 11 comments

Comments

@smfoster3
Copy link

I'm looking to have the last x number of words rotate at a different speed than the others. Say, have the first 20 phrases rotate at a speed of 500, and the last 5 rotate at a speed of 1000. I've been able to do this with the animation, but not the speed - so I've been unable to produce the desired result unfortunately. Any assistance would be much appreciated.

@MrSaints
Copy link
Owner

Hey @smfoster3, by speed are you referring to the delay between each phrase?

@smfoster3
Copy link
Author

Yes. Right now I have these settings:

$("#js-rotating").Morphext({ animation: "fadeIn", speed: 300,

What I would like to do is have the 'speed:' setting changed to, say, 600, for certain phrases. Let's say I have 20 phrases. I want the first 16 to rotate at 300, then the last 4 to rotate at 600. I attempted to do this with a similar settings to #12 in 'complete' but was unsuccessful.

@MrSaints
Copy link
Owner

MrSaints commented Mar 1, 2017

Ah I see, yea I was going to recommend using complete. Can I have a look at your code / attempt?

@smfoster3
Copy link
Author

Sure. I had tried something like this along with some other iterations to no avail:

`$("#js-rotating").Morphext({
animation: "rotateIn",
speed: 1000,
complete: function () {
if (this.index === 3) {
this.settings.speed = 2000;
}

}
});
`

Also important, I noticed that the settings do not reset after the phrases finish. So when I'm successful at altering animation, it will stay on that animation on the next run through the phrases.

Ultimately what I'm looking to do is have the phrases speed be quick for x number of phrases, and slower for y number of phrases, then reset when the animation runs through again.

Let me know if I'm not being clear. I greatly appreciate your help!

@MrSaints
Copy link
Owner

MrSaints commented Mar 1, 2017

I believe you are on the right track.

Have you tried something like this:

$("#js-rotating").Morphext({
    animation: "rotateIn",
    speed: 500,
    complete: function () {
        if (this.index > (this.phrases.length - 5)) {
            this.settings.speed = 2000;
        } else {
            this.settings.speed = 500;
        }
    }
});

Assuming you have 20 phrases (going back to your original post), we will use a speed of 2000 for anything after 15, and 500 for everything else.

Let me know if that helps.

@smfoster3
Copy link
Author

No that isn't working unfortunately. I believe I tried that at one point as well without success. Interestingly the this.settings.animation works just fine, as you can see in this demo.

To get that I have:

$("#js-rotating").Morphext({ animation: "fadeIn", speed: 500, complete: function () { if (this.index > (this.phrases.length - 4)) { this.settings.speed = 2000; this.settings.animation = "rotateIn"; } else { this.settings.speed = 500; this.settings.animation = "fadeIn" } } });

Still no change in speed though. I've been trying many things over the last few days and just can't seem to get it.

@jelm
Copy link

jelm commented Mar 2, 2017

Did any of you get this working? I have the same problem.

@smfoster3
Copy link
Author

I have not found a working solution yet no.

@mazc23
Copy link

mazc23 commented Mar 14, 2017

Good night, im stuck on an animation, the thing is , i have three lines paragraph, and they transalte in the animation from english to spanish, and the client wants, the english paragraph stays in english 15 seconds, and 4 seconds in spanish, and keep doing it in a loop, i only had achieved to change three times but then the animation stops. Can anyone help me? thanks

@MrSaints
Copy link
Owner

Apologies for the delay, I'll get back to this ASAP.

@jvreeken
Copy link

jvreeken commented Nov 8, 2018

Changing the settings.speed doesn't seem to work on complete... any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants