基本 jQuery 滑块中上一张/下一张幻灯片的自定义链接触发器

2022-01-24 00:00:00 slider jquery javascript

我正在开发一个基于 Basic jQuery Slider (http:///www.basic-slider.com) 由 John Cobb (https://github.com/jcobb/basic-jquery-slider).

I am working on a slider project based on the Basic jQuery Slider (http://www.basic-slider.com) creatd by John Cobb (https://github.com/jcobb/basic-jquery-slider).

问题:鉴于我的项目规范,我需要在当前幻灯片下方添加一个链接,该链接显示下一张幻灯片的标题,当单击该链接时,滑块将转到该幻灯片.

The problem: Given my project specs, instead of using the default controls, I need to add a link below the current slide that shows the title of the next slide and when that link is clicked the slider goes to the that slide.

我的问题:有没有办法使用简单的 jQuery 点击事件(例如 $('a.next).click(...[trigger]...)) 触发移动到下一张幻灯片?如何调用触发器?

My question: Is there a way to trigger the move to the next slide using a simple jQuery click event (e.g., $('a.next).click(...[trigger]...)) ? How can I call the trigger?

非常感谢您的帮助.

推荐答案

如果您将默认控件设置为隐藏,通过设置不透明度或不显示,您应该可以使用此代码:

If you set the default controls to hidden, either by setting the opacity or display none, you should be able to use this code:

$('a.next').click(function() {
    $('.bjqs-next a').trigger('click');
});

$('a.prev').click(function() {
    $('.bjqs-prev a').trigger('click');
});

相关文章