Lay Theme Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Search

    JS event on change of slide in carousel

    Addons
    3
    8
    402
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • F
      fbn last edited by

      Hi,

      is there an event that fires when the slide changes in the carousel addon? I checked the code and noticed Flickity is used, but I had no success trying to access its change event.

      Thanks in advance,
      Florian

      1 Reply Last reply Reply Quote 0
      • mariusjopen
        mariusjopen Global Moderator last edited by

        Dear @fbn
        it is not really possible to access this.
        Flickity is too integrated in the theme.

        Best!

        Marius

        www.mariusjopen.world

        1 Reply Last reply Reply Quote 0
        • F
          fbn last edited by

          Hi @mariusjopen,

          thanks for your reply. So that means there is no way to run an action on image change of the carousel? Is there a way to enable Flickity so I can use its events?

          Thanks,
          Florian

          1 Reply Last reply Reply Quote 0
          • mariusjopen
            mariusjopen Global Moderator last edited by

            Dear @fbn
            we are working on that regarding another question of a user.
            Just a moment…

            :-)

            Best!

            Marius

            www.mariusjopen.world

            1 Reply Last reply Reply Quote 0
            • F
              fbn last edited by

              Hi @mariusjopen,

              great to hear that, looking forward to it :)

              Best,
              Florian

              1 Reply Last reply Reply Quote 0
              • mariusjopen
                mariusjopen Global Moderator last edited by

                :-D Thank you for your patience!

                www.mariusjopen.world

                1 Reply Last reply Reply Quote 0
                • arminunruh
                  arminunruh Global Moderator last edited by

                  Hey!

                  Yeah of course you can use flickity's events!

                  window.laytheme.on('newpageshown', function(){
                  
                  jQuery('.lay-carousel.transition-sliding').on('select.flickity', function(event){
                  var flkty = Flickity.data( event.target );
                  var ix = flkty.selectedIndex;
                  console.log('do sth');
                  });
                  
                  });
                  
                  1 Reply Last reply Reply Quote 1
                  • F
                    fbn last edited by

                    Hey @arminunruh,

                    cool, thanks for the code example, that works! :)

                    Best,
                    Florian

                    1 Reply Last reply Reply Quote 1
                    • First post
                      Last post

                    Before you post

                    Use the Search Feature. Maybe there is already a solution to your issue.

                    1. Update Lay Theme and all Lay Theme Addons
                    2. Disable all Plugins
                    3. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code ", click "Save Changes"
                    4. Now see if your problem solved itself
                    5. Go here, see if your problem is listed here:
                    Troubleshooting

                    When you post:
                    1. Post a link to where the problem is
                    2. If the problem is difficult to explain, post screenshots / link to a video to explain it

                    Thanks!

                    Online Users

                    S
                    M
                    A
                    K
                    F
                    F
                    O
                    Y

                    Recent Topics

                    • K

                      Unable to update lay theme / to login wp admin

                    • S

                      Theme crashed - because of Polylang?

                    • A

                      New button feature not available

                    • A

                      carousel addon not working after update

                    laytheme.com