Giter Club home page Giter Club logo

Comments (7)

davidghi avatar davidghi commented on May 19, 2024

You could try to add it directly in the HTML code you create.

from slider-pro.

hudsonperalta avatar hudsonperalta commented on May 19, 2024

Yea, I tried that, I am doing CSS animations once the class .sp-selected gets added so if I hard code it then they don't animate. I was thinking if index 0 then add class .sp-selected

I'll keep trying thank you.

from slider-pro.

davidghi avatar davidghi commented on May 19, 2024

You can use the init event to add the class immediately after the initialization. You will need to pass the handler to this event in the list of options because if you pass it later it will be too late and it won't fire:

$( '.slider-pro' ).sliderPro({
    ...
    init: function() {}
});

from slider-pro.

hudsonperalta avatar hudsonperalta commented on May 19, 2024

How do I get the index in the init?

So then I can do if( index === 0 ) { ... }

from slider-pro.

davidghi avatar davidghi commented on May 19, 2024

The init is fired only once, so you don't need to check the index; you simply add the class to the first slide.

from slider-pro.

davidghi avatar davidghi commented on May 19, 2024

The 'sp-selected' class is added by default to the initially selected slide in version 1.2.0.

from slider-pro.

hudsonperalta avatar hudsonperalta commented on May 19, 2024

@davidghi Awesome! Thank you

from slider-pro.

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.