I recently posted a question concerning the possibility of different scroller div
with the same class name. It works perfectly.
Here is the link of the thread: Scroll multiple div at the same time
Lately, I've made changes in my code to make all the div
dynamic (with ng-repeat
). Since these changes, my jquery function no longer works. I think the javascript is executed before my various ng-repeat
is completed.
My function to scroll on all the container with the same class name :
var subCatContainer = $(".sub-category-container");
subCatContainer.scroll(function() {
subCatContainer.scrollLeft($(this).scrollLeft());
});
Is there a solution in order to wait for my ng-repeat
? in a directive?
To complete my explanation, I created a : JSFiddle