My question is how to trigger or call a function after an element has been loaded or element on the page and don't want to wait for the full page load.
Example Fiddle: http://jsfiddle.net/8bJUc/275/
Problem Fiddle: http://jsfiddle.net/8bJUc/274/
Call JS:
document.getElementsByClassName("owlCarousel").onLoad = function(){
// do stuff
$("#owl-demo").owlCarousel({
navigation: true,
pagination: true,
lazyLoad: true
});
};
HTML:
<span class='slide'>
<div id="owl-demo" class="owl-carousel"> <!-- If .owl-carousel has been loaded -->
<div>
<!-- Contents -->
</div>
</div>
</span>
So i mean that if .slide
has .owl-carousel
class then call function will be work.
Expecting suggestions?