简体   繁体   English

基本jQuery滑块-当前幻灯片编号

[英]Basic jQuery Slider - Current Slide Number

I'm currently having issues displaying the current slide number, basically I need to have the current slides number inserted into a span class called current slide. 我目前在显示当前幻灯片编号时遇到问题,基本上我需要将当前幻灯片编号插入一个称为“当前幻灯片”的跨度类中。 I'm using follow jquery slider: http://basic-slider.com 我正在使用关注jquery滑块: http : //basic-slider.com

I'm using this snippet to call the script. 我正在使用此片段来调用脚本。

    jQuery(document).ready(function($) {

      var total = jQuery('.bjqs li').length;

      $('#banner-slide').bjqs({
        animtype      : 'slide',
        height        : 490,
        width         : 695,
        showmarkers   : false,
        responsive    : false

      });

      jQuery('#slider-status > .total-slides').html(total);


    });

According to the design it needs to be shown as 1(current slide) / 3(being total amount) 根据设计,它需要显示为1(当前幻灯片)/ 3(总计)

Any help would be very much appreciated! 任何帮助将不胜感激!

Try this: 尝试这个:

$('#banner-slide').bjqs({
    animtype      : 'slide',
    height        : 490,
    width         : 695,
    showmarkers   : true, // set it to true
    responsive    : false

});

From http://basic-slider.com/ http://basic-slider.com/

showmarkers : true, // Show individual slide markers

如果不使用bjqs min文件,则可以修改set_next function以获取当前幻灯片编号并将其绑定到跨度。

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

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