Git Product home page Git Product logo

Comments (10)

weepy avatar weepy commented on September 3, 2024

i don't think is easy. u'll have to create a separate path :s as far as I know. unless jQuery has some new functionality to abort animations.

from jquery.path.

notpit avatar notpit commented on September 3, 2024

Well, there is the step function of the method. I've been playing around with it. Although, I haven't exactly figure it out. I think it has the potential to function this way.

However, when applying it to your plugin, the step function does not seem to return any values.

What do you mean create a separate path?

from jquery.path.

notpit avatar notpit commented on September 3, 2024

Bah.. I didn't mean to hit Comment and Close...

from jquery.path.

weepy avatar weepy commented on September 3, 2024

could u use stop (http://api.jquery.com/stop/) within the step function perhaps ?

from jquery.path.

notpit avatar notpit commented on September 3, 2024

Well, I haven't quite figured out how to call stop() from within the step function if you even can, but you can do some neat things with it. I have some code, but I don't know how to post it in there.

On the other hand, I can't get the step function to work while using your Path plugin. Perhaps I'm missing something?

from jquery.path.

notpit avatar notpit commented on September 3, 2024

Ok, just figured out how to call stop() from step, but it doesn't work with your Paths plugin. The same data isn't being accessed when being pushed through Paths.

from jquery.path.

notpit avatar notpit commented on September 3, 2024

Check it out..
Change
var css = fx.end.css(1 - fx.pos)

to
var css = fx.end.css(fx.pos/2)

Could change the code to accept a param there maybe.

from jquery.path.

notpit avatar notpit commented on September 3, 2024

Alright, so I'm still hacking away at this. I brought the divisor in as a param, not sure that's the way to go though. Playing around with some loops now to see if I can make the divisor work...

from jquery.path.

weepy avatar weepy commented on September 3, 2024

try

var css = fx.end.css(1 - fx.pos*param)

where param is between 0 and 1

from jquery.path.

aquargna avatar aquargna commented on September 3, 2024

I was able to get an animation to stop at an arbitrary point along the curve by using step and stop()

$("#mover2").animate({path : new $.path.bezier(bezier_params)},
{step: function(now, fx) {
if (fx.pos > .5) {$(this).stop(true, false)}; //when the position param of fx gets bigger than .5, stop the animation
}
}

from jquery.path.

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.