ajax加载后猫头鹰轮播无法正常工作 [英] owl carousel not working after ajax load

查看:108
本文介绍了ajax加载后猫头鹰轮播无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用jquery 1.11和这段代码来ajax加载侧边栏中的wordpress post内容.一切都很好,但是owl carousel的jquery函数不起作用,并且帖子内容中的carousel不显示任何内容. ajaxify代码以加载帖子内容:

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.

推荐答案

这对我有用:

jQuery(function () {
  jQuery(document).ready(function () {
    setInterval(function () {
      jQuery(".owl-carousel").owlCarousel();
    }, 1500);
  });
});

这篇关于ajax加载后猫头鹰轮播无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆