问题
i use jquery 1.11 and this code to ajax load wordpress post content in sidebar . everything is good but jquery functions of owl carousel not work and the carousel in post content not showing anything. ajaxify code to load post content:
$(document).ready(function(){
$.ajaxSetup({cache:false});
$(".post-link").click(function(){
var post_link = $(this).attr("href")+' #content';
$("#single-post-container").html("loading ...");
$("#single-post-container").load(post_link);
return false;
});
});
is there any way to solve this problem and conflict? best regards.
回答1:
This worked for me :
jQuery(function () {
jQuery(document).ready(function () {
setInterval(function () {
jQuery(".owl-carousel").owlCarousel();
}, 1500);
});
});
来源:https://stackoverflow.com/questions/27903139/owl-carousel-not-working-after-ajax-load