【问题标题】:owl carousel not working after ajax loadajax加载后猫头鹰轮播不工作
【发布时间】:2015-01-12 13:30:43
【问题描述】:

我使用 jquery 1.11 和此代码在侧边栏中 ajax 加载 wordpress 帖子内容。一切都很好,但 owl carousel 的 jquery 功能不起作用,帖子内容中的 carousel 没有显示任何内容。 ajaxify 代码加载帖子内容:

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

});

有没有办法解决这个问题和冲突? 最好的问候。

【问题讨论】:

标签: jquery ajax wordpress owl-carousel


【解决方案1】:

这对我有用:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-02-04
    • 2022-01-07
    • 2014-10-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多