Giter Club home page Giter Club logo

Comments (11)

MrSaints avatar MrSaints commented on May 26, 2024

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

from morphext.

smfoster3 avatar smfoster3 commented on May 26, 2024

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.

from morphext.

MrSaints avatar MrSaints commented on May 26, 2024

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

from morphext.

smfoster3 avatar smfoster3 commented on May 26, 2024

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!

from morphext.

MrSaints avatar MrSaints commented on May 26, 2024

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.

from morphext.

smfoster3 avatar smfoster3 commented on May 26, 2024

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.

from morphext.

jelm avatar jelm commented on May 26, 2024

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

from morphext.

smfoster3 avatar smfoster3 commented on May 26, 2024

I have not found a working solution yet no.

from morphext.

mazc23 avatar mazc23 commented on May 26, 2024

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

from morphext.

MrSaints avatar MrSaints commented on May 26, 2024

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

from morphext.

jvreeken avatar jvreeken commented on May 26, 2024

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

from morphext.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.