Marek123
Marek123

Reputation: 1211

AngularJS - Call jquery after load

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?

Upvotes: 0

Views: 649

Answers (1)

Okan Kocyigit
Okan Kocyigit

Reputation: 13421

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();
});

Upvotes: 1

Related Questions