jQuery BxSlider 淡入淡出

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11302657/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 10:27:00  来源:igfitidea点击:

BxSlider Fade in and Out

jquerycsssliderbxslider

提问by Owen O'Neill

StackOverflow'ers

StackOverflow'ers

I am new to jQuery but I am currently using the BXslider Plug in.

我是 jQuery 新手,但我目前正在使用 BXslider 插件。

<script type="text/javascript">
  $(document).ready(function(){
    $('#slider').bxSlider();
  });
</script>

All I want to do is to make the slider, on each slide, slide in and out, left-to-right.

我想要做的就是让滑块在每张幻灯片上从左到右滑入和滑出。

回答by Connor

In the link you posted are all your options to customize the plugin. You can change the values like this:

在您发布的链接中,您可以选择自定义插件。您可以像这样更改值:

$(document).ready(function(){
    $('#slider').bxSlider({
    mode: 'fade',
    });
});

If you are looking for more transition/easing options, you will need to include jQuery Easing. Get that here: http://gsgd.co.uk/sandbox/jquery/easing/

如果您正在寻找更多过渡/缓动选项,则需要包含 jQuery Easing。在这里获取:http: //gsgd.co.uk/sandbox/jquery/easing/

Then add the easing option like this:

然后像这样添加缓动选项:

easing: 'swing',

FYI 'swing' is the default.

仅供参考 'swing' 是默认值。

回答by Filipe Manuel

The ID of your list or div has to be equal to what is the jQuery code.

您的列表或 div 的 ID 必须与 jQuery 代码相同。

See if there are other codes that were not properly closed and that might be interfering with this.

查看是否有其他代码未正确关闭并且可能会干扰此操作。

Make sure added the version of jQuery that is compatible with the plugin and added the .min.js in the page header.

确保添加了与插件兼容的 jQuery 版本并在页眉中添加了 .min.js。