Coder Social home page Coder Social logo

Comments (9)

revolunet avatar revolunet commented on August 25, 2024

you can easily create your own indicator :

<ul rn-carousel rn-carousel-index="index"><li ng-repeat="item in items">...</li></ul>
<div>{{ index }} / {{ items.length }}</div>

any other idea ?

from angular-carousel.

atian25 avatar atian25 commented on August 25, 2024

I saw this at source:

    template: '<div class="rn-carousel-indicator">' +
                '<span ng-repeat="item in items" ng-class="{active: $index==$parent.index}">●</span>' +
              '</div>'

so I wonder why not support lable before the

image
text -----------> ●●●

from angular-carousel.

ManuelColombo avatar ManuelColombo commented on August 25, 2024

I put my own symbol directly on the source.
There is a way to navigate the gallery from indicator?

from angular-carousel.

revolunet avatar revolunet commented on August 25, 2024

@ManuelColombo you mean when you click an indicator to switch to given slide ?

from angular-carousel.

ManuelColombo avatar ManuelColombo commented on August 25, 2024

@revolunet yes I mean exactly what you said

from angular-carousel.

ManuelColombo avatar ManuelColombo commented on August 25, 2024

I modified the min.js this way
`template:'




'}}])`

Within ng-click I assign to $parent.index the clicked one's value, it changes my index and move the active bull but doesn't affect the picture.
In my gallery I've two arrow (prev and next) enabled or disabled according to the index of the rn-carousel-index variable. The code in ng-click affect those arrow but not my images.

from angular-carousel.

revolunet avatar revolunet commented on August 25, 2024

i should implement directive controller pattern

from angular-carousel.

EthanNguyen132 avatar EthanNguyen132 commented on August 25, 2024

@revolunet, @ManuelColombo
hi, to write a custom indicator, you may want to override the template of "rnCarouselIndicators" & write your own CSS.
To make the indicator become a real "navigator". you can access parent scope of the directive's scope and pay attention to "goToIndex" function of carouselCollection (managed by carouselmanager).
here's a working piece of code

.directive('rnCarouselIndicators', [function() {
.......
template:


link: function(scope, element, attrs, model) {
scope.goToIndex = function(index, bool){
scope.$parent.carouselCollection.goToIndex(index, bool);
};
console.log();
}
};
}]);

if there's something to improve, that's the animation, currently it's quite laggy compared to bootstrap carousel (via angular directive).
Since my carousel has too many slides, I switch to this carousel to take advantage of "buffered" functionality to prevent rendering overhead.

from angular-carousel.

revolunet avatar revolunet commented on August 25, 2024

Hi guys, FYI, a new refactored version has been pushed, and support clickable indicators.
There's a demo with custom controls and thumbnail navigation...
So basically, for a custom indicator you just need to bind the rn-carousel-index :)

from angular-carousel.

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.