第二个猫头鹰旋转木马照片滑块无法正常工作

时间:2014-05-21 09:04:04

标签: jquery owl-carousel

我已经忙了一段时间,在这里问了几个问题。
但这是整个代码,关于第二个旋转木马不能工作,第一个工作得很好。

感谢。

http://pastebin.com/wtPgi4cV

2 个答案:

答案 0 :(得分:1)

要同时使用更多的猫头鹰旋转木马,只需使用不同的" id"

的JavaScript

$(document).ready(function() {

  $("#owl-demo1").owlCarousel();
  $("#owl-demo2").owlCarousel();

});

HTML

<div id="owl-demo1" class="owl-carousel">
    <div class="item"><img src="slide1.jpg"></div>
    <div class="item"><img src="slide2.jpg"></div>
    <div class="item"><img src="slide3.jpg"></div>
    <div class="item"><img src="slide4.jpg"></div>
    <div class="item"><img src="slide5.jpg"></div>
    <div class="item"><img src="slide6.jpg"></div>
</div>

<div id="owl-demo2" class="owl-carousel">
    <div class="item"><img src="slide7.jpg"></div>
    <div class="item"><img src="slide8.jpg"></div>
    <div class="item"><img src="slide9.jpg"></div>
    <div class="item"><img src="slide10.jpg"></div>
    <div class="item"><img src="slide11.jpg"></div>
    <div class="item"><img src="slide12.jpg"></div>
</div>

答案 1 :(得分:0)

<强> HTML

$(function() {
    //user could hit enter in the input field, bind on submit instead
    $("form[name='classified']").on('submit', function() {
        var $classified = $('input[name="classified"]');
        console.log($classified.val());
    });
});

<强>的JavaScript

<div class="crousel-set">
    <div class="item"><img src="slide1.jpg"></div>
    <div class="item"><img src="slide2.jpg"></div>
    <div class="item"><img src="slide3.jpg"></div>
    <div class="item"><img src="slide4.jpg"></div>
    <div class="item"><img src="slide5.jpg"></div>
    <div class="item"><img src="slide6.jpg"></div>
</div>

<div class="crousel-set">
    <div class="item"><img src="slide7.jpg"></div>
    <div class="item"><img src="slide8.jpg"></div>
    <div class="item"><img src="slide9.jpg"></div>
    <div class="item"><img src="slide10.jpg"></div>
    <div class="item"><img src="slide11.jpg"></div>
    <div class="item"><img src="slide12.jpg"></div>
</div>