猫头鹰旋转木马连续滑动,没有延迟停止,应立即停止悬停

时间:2016-07-15 07:08:04

标签: javascript plugins jquery-plugins owl-carousel

Hii我试图在单张幻灯片中毫不拖延地使用猫头鹰旋转木马连续滑动,滑动应该立即停止悬停..任何人都可以帮帮我..

2 个答案:

答案 0 :(得分:0)

查看您需要使用的文档owl-carosuel stopOnHover

$("#owl-demo").owlCarousel({
      autoPlay: 3000, //Set AutoPlay to 3 seconds
      stopOnHover: true,
      items : 4,
      itemsDesktop : [1199,3],
      itemsDesktopSmall : [979,3]
  });

答案 1 :(得分:0)

您需要将 stopOnHover 选项添加为 true 到您的 js 文件。根据 owl carosuel 的文档,如果我们想在鼠标悬停在 It 上时停止滑动,我们可以设置 stopOnHover: true; 为了顺利滑动幻灯片,您必须使用 autoplayTimeout 选项,这有助于我们以毫秒为单位设置时间。所以你的代码应该是这样的:

$(document).ready(function(){
 $('.owl-carousel').owlCarousel({
  loop: true,
  autoplay: true,
  autoplayTimeout: 2000, // 2 sec you can change it as per you choice.(time between tow slide changes).
  stopOnHover: true, // To stop sliding on hover.
  responsive: {
        0: {
            items: 1
           },
        600: {
            items: 2
           },
        1190: {
            items: 3
            }
           }             
 });
});