Hi Sander! Okay! so here goes the education ;-))
see the following fiddle: http://jsfiddle.net/yp0o9qzt/4/ first of all, I need to instanciate scooch to get a working (scrollable) carousel. I do this by the following code: $('.m-scooch').scooch() inside the document.ready() I think the instanciation does not need to be implemented in de directive of the dropdown though. Secondly, I use $('.m-item').removeClass('m-active') because of the following: To demonstrate: Please load the fiddle, and go to the third thumbnail (second outlander thumbnail). Now change the dropdown to "english". You see that the m-active class stays active on the second outlander movie. Thirdly, I made a jQuery prototype extension in de scooch.js, that will allow the carousel to reset, to if I change the filter, the carousel needs to be reset to its beginning position. I do this with the following code, inside the scooch.js: Scooch.prototype.reset = function() { this.initElements(this.element); this.initOffsets(); this.initAnimation(); this.move(1); }; And i run this code by $('.m-scooch').scooch('reset'); Hope this explenation is sufficient ;-) Op donderdag 25 september 2014 13:44:50 UTC+2 schreef Sander Elias: > > Hi Jan Willem > > Well, you first have to loose the jQuery habit before you will be able to > make well-function directives ;) > This one is not that hard, and mostly an template directive, so you might > give it a go. > > You don’t need the $('.m-item').removeClass('m-active'); at all, you have > ng-class="{'m-active':$first}" in your template, and that takes care of > that. > > I have no clue what the $('.m-scooch').scooch('reset') does, so I can’t > tell you anything about that. If you want me to help you, you have to > educate me a bit > about it. > > Regards > Sander > > -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
