简体   繁体   English

Basic jQuery Slider中上一张/下一张幻灯片的自定义链接触发器

[英]Custom Link Trigger for Previous/Next Slide in 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 ). 我正在基于John Cobb( https://github.com/jcobb/basic-jquery-slider )创建的Basic jQuery Sliderhttp://www.basic-slider.com )创建一个滑块项目。

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. 问题:给定我的项目规格,而不是使用默认控件,我需要在当前幻灯片下方添加一个链接,以显示下一张幻灯片的标题,并在单击该链接时将其转到该幻灯片。

My question: Is there a way to trigger the move to the next slide using a simple jQuery click event (eg, $('a.next).click(...[trigger]...)) ? 我的问题:有没有一种方法可以使用简单的jQuery click事件(例如$('a.next).click(... [trigger] ...))来触发移至下一张幻灯片? How can I call the trigger? 如何调用触发器?

Thank you very much for your help. 非常感谢您的帮助。

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');
});

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM