Reputation: 1211
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
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