在document.ready的Ajax选项卡中未加载旋转木马

Carousel not loading within Ajax Tab on document.ready?

本文关键字:加载 旋转木马 选项 document ready Ajax      更新时间:2023-09-26

所以我在一个外部页面上有一个旋转木马,当在主页上单击Ajax选项卡时,它会被拉入,直到我刷新页面,这个旋转木马才会显示。有什么办法让它出现吗??我的javascript代码有问题吗。如果有什么不同的话,这个页面也在asp.net服务器上。

转盘在Why CEC内http://testing.morecleanenergy.com/step_1

这是我在主页上的标签,它在页面的底部。。

<script>
$(document).ready(function(){
  $('#ajax-tab-container').easytabs();
  $("#tabs2").load('/tab2.html');
  $("#tabs3").load('/tab3b.html');
  $("#tabs4").load('/tab4.html');
  $("#owl-demo").owlCarousel({
      navigation : true,
      slideSpeed : 300,
      paginationSpeed : 400,
      singleItem : true
      });
});
</script>

它对我来说很好,请确保你的浏览器没有缓存!我在Firefox和Chrome上测试了它的Windows 8

您收到了以下错误:

ReferenceError: Sys is not defined (line 44, column 8)

这意味着第44行正在随机中断您的JavaScript执行:

Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);

所以这个错误出现了:

$(...).owlCarousel is not a function

并且您的旋转木马不会被渲染。

试着拆下或修理44号线,你就会摆脱这个麻烦。