简体   繁体   English

如果我使用有错误的代码,为什么我的下拉菜单停止工作?

[英]Why does my dropdown stop working if I use code with errors?

This drop down code is working: 此下拉代码有效:

$(document).ready(function(){

 $('.owl-wrapper').owlCarousel({
    loop:true,
    margin:0,
    nav:true,
    autoPlay: 100,
    responsive:{
        0:{
            items:1
        },
        600:{
            items:2
        },
        1000:{
            items:3
        }
    }
})

This drop down code is not working: Why? 此下拉代码不起作用:为什么?

$(document).ready(function(){

 $('.owl-wrapper').owlCarousel({
    loop:true,
    margin:0,
    nav:true,
    autoPlay: 100,
    responsive:{
        0:{
            items:
        },
        600:{
            items:2
        },
        1000:{
            items:3
        }
    }
})

You have missed to give the value to items in your second example. 您没有在第二个示例中为项目赋予值。 You need to give it a value as you have given in your first example. 您需要像在第一个示例中那样给它一个值。

 $(document).ready(function(){

 $('.owl-wrapper').owlCarousel({
    loop:true,
    margin:0,
    nav:true,
    autoPlay: 100,
    responsive:{
        0:{
            items:1
        },
        600:{
            items:2
        },
        1000:{
            items:3
        }
    }
});

You can always check here to know how to use the owlCarousel. 您随时可以在这里查看以了解如何使用owlCarousel。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么我的代码在几个循环后停止工作? - Why does my code stop working after few loops? 为什么当我使用JQuery DatePicker时Google Code Prettifier停止工作(反之亦然) - Why does Google Code Prettifier stop working when I use JQuery DatePicker (or vice versa) 如果我添加一个变量,为什么我的程序停止工作? - Why does my program stop working if I add a variable? 删除静音后,为什么我的自动播放停止工作? - Why does my autoplay stop working when I remove mute? 我的代码刚刚决定停止工作,我不知道为什么。 (javascript 谷歌 appscript) - My code just decided to stop working and I don't know why. (javascript google appscript) 将jquery插件放入div容器后,为什么我的jquery插件停止工作? - Why does my jquery plugin stop working after I put it in a div container? 如果我添加 if 语句,为什么我的 jQuery 自动刷新停止工作? - why does my jQuery auto-refresh stop working if I add in a if statement? 为什么当我尝试使用 props 传递的函数时 preventDefault 停止工作? - Why does preventDefault stop working when I try to use a function passed by props? 为什么.match() 会阻止我的代码执行? - Why does .match() stop my code from executing? 为什么我的javascript else语句停止工作 - Why does my javascript else statement stop working
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM