猫头鹰旋转木马不会自动播放 [英] Owl Carousel Won't Autoplay

查看:155
本文介绍了猫头鹰旋转木马不会自动播放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的网站上使用猫头鹰旋转木马。根据他们的文档,这段JavaScript应该可以工作:

 < script> 
$(#intro)。owlCarousel({

//最重要的猫头鹰特征

//自动播放
autoPlay:5000,
stopOnHover:false
)}
< / script>

但由于某些原因,它不会自动播放。这里是滑块的HTML:

 < div id =introclass =owl-carousel> 
< div class =item first>
< div class =container>
< div class =row>
< div class =carousel-caption-left color-white>
< h2>标题文字< / h2>
< h1>小标题文字在这里。< / h1>
< p>如果您喜欢,您甚至可以在此处添加一个或两个句子。< / p>
< / div>
< / div>
< / div>
< div class =overlay-bg>< / div>
< / div>
< div class =item second>
< div class =container>
< div class =carousel-caption-left color-white>
< h2>标题文字< / h2>
< h1>小标题文字在这里。< / h1>
< p>如果您喜欢,您甚至可以在此处添加一个或两个句子。< / p>
< / div>
< / div>
< div class =overlay-bg>< / div>
< / div>
< div class =item third>
< div class =container>
< div class =carousel-caption-left color-white>
< h2>标题文字< / h2>
< h1>小标题文字在这里。< / h1>
< p>如果您喜欢,您甚至可以在此处添加一个或两个句子。< / p>
< / div>
< / div>
< div class =overlay-bg>< / div>
< / div>
< / div>

以下是链接到自己的Carousel文档的链接: http://owlgraphic.com/owlcarousel/#how-to

解决方案

是的,它是一个输入错误。

写入


autoPlay

不是


自动播放


自动播放插件代码将变量定义为autoPlay。


I'm using the Owl Carousel on my site. According to their documentation, this piece of JavaScript should work:

<script>
$("#intro").owlCarousel({

// Most important owl features

//Autoplay
autoPlay : 5000,
stopOnHover : false
)}
</script>

But for some reason it will not autoplay. Here is the HTML of the slider:

<div id="intro" class="owl-carousel">
    <div class="item first">
      <div class="container">
        <div class="row">
          <div class="carousel-caption-left colour-white">
            <h2>Title Text</h2>
            <h1>Sub title text here.</h1>
            <p>If you like you can even add a sentence or two here.</p>
          </div>
        </div>
      </div>
      <div class="overlay-bg"></div>
    </div>
    <div class="item second">
      <div class="container">
        <div class="carousel-caption-left colour-white">
          <h2>Title Text</h2>
          <h1>Sub title text here.</h1>
          <p>If you like you can even add a sentence or two here.</p>
        </div>
      </div>
      <div class="overlay-bg"></div>
    </div>
    <div class="item third">
      <div class="container">
        <div class="carousel-caption-left colour-white">
          <h2>Title Text</h2>
          <h1>Sub title text here.</h1>
          <p>If you like you can even add a sentence or two here.</p>
        </div>
      </div>
      <div class="overlay-bg"></div>
    </div>
</div>

Here is the link to the own Carousel documentation: http://owlgraphic.com/owlcarousel/#how-to

解决方案

Yes, its a typing error.

Write

autoPlay

not

autoplay

The autoplay-plugin code defines the variable as "autoPlay".

这篇关于猫头鹰旋转木马不会自动播放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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