0

I have an image slider on my page:
That is my call:

<div id="slider">
    <ul class="bjqs">
        <li ng-repeat="image in dealer.images"><img src="{{image}}" alt="{{image}}" /></li>   
    </ul>
</div>

Somehow the slider doesn't work. I think I have to load the jQuery init after the images are loaded.
This is the call for the slider:

$('#slider').bjqs({
            height      : 420,
            width       : 130,
            responsive  : true
          });  

How can I call this function after the images are loaded?

Marek123
  • 1,193
  • 7
  • 35
  • 75
  • 1
    Maybe [ngSrc](http://docs.angularjs.org/api/ng.directive:ngSrc) or [this post](http://stackoverflow.com/questions/11454383/angularjs-targeting-elements-inside-an-ng-repeat-loop-on-document-ready) can help? – Gloopy Jan 07 '13 at 04:03

1 Answers1

1

If you are sure that's the problem than you can use Nick Craver's solution

$(".bjqs img").one('load', function() {
   $('#slider').bjqs({
       height      : 420,
       width       : 130,
       responsive  : true
   });  
}).each(function() {
   if(this.complete) $(this).load();
});
Community
  • 1
  • 1
Okan Kocyigit
  • 13,203
  • 18
  • 70
  • 129