Git Product home page Git Product logo

Comments (8)

ganlanyuan avatar ganlanyuan commented on July 30, 2024 1

Hey,
The feature is added in dev2.
To change a slider from carousel to fade , just change the mode option from carousel to gallery:

var slider = tns({
  mode: 'gallery',
  other: options
});

To use other animations (like animate.css), 3 options (classes) are available to define the animation. A delay can also be setup between each two slides if you have more than one slide in a page.

var slider = tns({
  mode: 'gallery',
  animateIn: 'fadeInDown',
  animateOut: 'fadeOutDown',
  // animateNormal: 'tns-normal',
  animateDelay: 300,
  other: options
});

I'm doing a E2E testing right now. Would you be able to try it out at the same time?
Thanks

from tiny-slider.

ganlanyuan avatar ganlanyuan commented on July 30, 2024

Hey,
Will consider add this function soon. Maybe not only fade, other transforms can be added too.
Please let me know if you have any idea about this.

from tiny-slider.

lonepalmus avatar lonepalmus commented on July 30, 2024

that sounds great! well besides the fade, i dont have any fancy ideas. Slide and fade seems to be default options for most sliders. Maybe it could be to give users the possibility to create custom transitions?

from tiny-slider.

ganlanyuan avatar ganlanyuan commented on July 30, 2024

Agree.
Will let you know when the function is added.

from tiny-slider.

ganlanyuan avatar ganlanyuan commented on July 30, 2024

The feature is added to master branch.

from tiny-slider.

yellow1912 avatar yellow1912 commented on July 30, 2024

I'm thinking if you should leave the animation to the users somehow. For example, there are many libraries out there such as Animate.css and GSAP tween that support advanced animation. It would be totally cool to allow end-users to use those libs if they want to.

One way would be to accept functions for animation in and out and use them to animate somehow.

from tiny-slider.

ganlanyuan avatar ganlanyuan commented on July 30, 2024

@yellow1912 Yes, it does allow user-defined animations.
You can use any library or write the animation by yourself. Simply pass the classes to the options. An example can be found here.
You can do js animation as well using custom events.

from tiny-slider.

yellow1912 avatar yellow1912 commented on July 30, 2024

Interesting. I expected the animateIn and animateOut to take "functions", but perhaps it can work the way you say as well.

from tiny-slider.

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.