Giter Site home page Giter Site logo

Comments (9)

maxwellito avatar maxwellito commented on July 30, 2024

About the callback:

// Inline SVG
new Vivus('my-svg-id', {type: 'delayed', duration: 200}, myCallback);

// Dynamic load
new Vivus('my-div-id', {type: 'delayed', duration: 200, file: 'link/to/my.svg'}, myCallback);

The Vivus constructor asks for 3 parameters:

  • ID (or object) of DOM element to interact with.
    It can be an inline SVG or a wrapper element to append an object tag from the option file
  • Option object (described in the following)
  • _Callback to call at the end of the animation (optional)_

from the readme.md file

About the method play:

  • play(speed) Plays the animation with the speed given in parameter. This value can be negative to go backward, between 0 and 1 to go slowly, or superior to 1 to go fast. By default the value is 1.

from the readme.md file

Btw, at no point Vivus use time for duration, but frames. Because browser can render at different speed depending on the heaviness of the page and performances of the machine. So to ensure a smooth animation Vivus use keyframes.

from vivus.

Szymon-dziewonski avatar Szymon-dziewonski commented on July 30, 2024

yeah but callback is working only with first animation it does not work when trigger play. Callback starts with staring animation than thats why I asked, I saw this in docs and it doesnt work with trigger .play()

Ok thanks for explenation of play(speed).

from vivus.

maxwellito avatar maxwellito commented on July 30, 2024

The callback is always triggered at the end of the animation. There's no
callback for when the animation start.
On 28 Aug 2015 8:03 am, "Szymon Dziewoński" [email protected]
wrote:

yeah but callback is working only with first animation it does not work
when trigger play. Callback starts with staring animation than thats why I
asked, I saw this in docs and it doesnt work with trigger .play()

Ok thanks for explenation of play(speed).


Reply to this email directly or view it on GitHub
#65 (comment).

from vivus.

Szymon-dziewonski avatar Szymon-dziewonski commented on July 30, 2024

Yeah but it works on start Im gonna show you, recreate problem
http://esthechoc.vrs.ovh/index.html
kraften section and first dot on left bottom
On console in dev tools it triggers when animations starts not end
main.settings.js line 71 settings for this callback, line 64 function set

from vivus.

maxwellito avatar maxwellito commented on July 30, 2024

I'm sorry but on my machine, the callback is triggered at the end of the animation.

screen shot 2015-08-29 at 13 44 40
screen shot 2015-08-29 at 13 44 43
screen shot 2015-08-29 at 13 44 44

from vivus.

Szymon-dziewonski avatar Szymon-dziewonski commented on July 30, 2024

yeah on first animation - you are right. BUt then when u click another bullet and go back to first again you get callback on start animation. I checked it so many times..

from vivus.

maxwellito avatar maxwellito commented on July 30, 2024

The behavior is normal. You just trigger play on point1 when the previous section begin to appear. So the animation start before you can see it, and the callback is executed before you can see your point.

screen shot 2015-08-29 at 16 01 53
screen shot 2015-08-29 at 16 02 06

from vivus.

Szymon-dziewonski avatar Szymon-dziewonski commented on July 30, 2024

Ok now I think I get it,seems you were right all along, sorry for wasting
your time.
I did few tests on single objects, and now I see even with play(-speed) it
triggers too but at start as animation is backward
Thank you anyway for patience :)

2015-08-29 17:04 GMT+02:00 maxwellito [email protected]:

The behavior is normal. You just trigger play on point1 when the previous
section begin to appear. So the animation start before you can see it, and
the callback is executed before you can see your point.

[image: screen shot 2015-08-29 at 16 01 53]
https://cloud.githubusercontent.com/assets/1097232/9562584/8e7e3800-4e67-11e5-80fa-5fd9ab7bfef9.png
[image: screen shot 2015-08-29 at 16 02 06]
https://cloud.githubusercontent.com/assets/1097232/9562585/91c3423a-4e67-11e5-87fb-9b5a0c5a5fdf.png


Reply to this email directly or view it on GitHub
#65 (comment).


Pozdrawiam,
Szymon Dziewoński

www.szymondziewonski.com
http://www.szymondziewonski.com

from vivus.

maxwellito avatar maxwellito commented on July 30, 2024

no worries :-)

from vivus.

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.