Coder Social home page Coder Social logo

Comments (2)

brh55 avatar brh55 commented on June 18, 2024

Each slider has it's own isolated scope, so this can be a bit of a challenge.

You could create an event when the slider slides, and emit an event with the current index. Then a event listener can invoke a .slideTo to the other slider with the passed index.

You could a bind it to the onSlideChangeEnd event, and transition the opposite slider.

Possible ideas, not sure how perfectly sync it would be however.

from angular-swiper.

edamon avatar edamon commented on June 18, 2024

In order to achieve this, I had to add the swiper_uuid to the swiper instance:
$timeout(function() {
var swiper = null;

                if (angular.isObject($scope.swiper)) {
                    $scope.swiper = new Swiper($element[0].firstChild, params);
                    swiper = $scope.swiper;
                } else {
                    swiper = new Swiper($element[0].firstChild, params);
                }
                swiper.swiper_uuid = $scope.swiper_uuid;  //<--add uuid to swiper instance
                console.log(swiper.swiper_uuid);
                //If specified, calls this function when the swiper object is available
                if (!angular.isUndefined($scope.onReady)) {
                    $scope.onReady({
                        swiper: swiper
                    });
                }
            });

I'll try to make a pull request soon

from angular-swiper.

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.