When reloading Slider, neither forward nor back has effect


Lucas Santos

I am using bxSlider and in the following situation

When a specific year is selected, I need to reload the month and just have the month in the clicked year value.

My problem is that when reloading, I let go of the arrow controls, i.e., I can't move forward or backward.

self.UpdateMensalTab = function (year, tab) {
    var url2 = _URL_UPDATE_TAB_MENSAL_;
    $(".slider2").html("");
    $.ajax({
        url: url2,
        type: 'POST',
        async: true,
        dataType: 'html',
        data: { "Year": year },
        success: function(result) {
            $(".slider2").html(result);
        }
    });

    $('.slider2').bxSlider({
        pager: false,
        infiniteLoop: false,
        slideWidth: 100,
        minSlides: 6,
        maxSlides: 6,
        slideMargin: 1,
        autoControls: true,
        adaptiveHeight: true,
        startSlide: 1
    });
}

image

Even though there is data showing that both buttons can be moved forward or backward, they no longer work. who can help me?

enter image description here

Sellin

bxSlider has a function called reloadSlider. you can use something like

var slider = $('.bxslider').bxSlider({
    mode: 'horizontal'
});

$('#reload-slider').click(function(e){
    e.preventDefault();
    slider.reloadSlider({
        mode: 'fade',
        auto: true,
        pause: 1000,
        speed: 500
    });
});

For more details see this

Also, after adding new content, you should refresh the slider.

self.UpdateMensalTab = function (year, tab) {
    var url2 = _URL_UPDATE_TAB_MENSAL_;

    $(".slider2").html("");

    window.slider = $('.slider2').bxSlider({
        pager: false,
        infiniteLoop: false,
        slideWidth: 100,
        minSlides: 6,
        maxSlides: 6,
        slideMargin: 1,
        autoControls: true,
        adaptiveHeight: true,
        startSlide: 1
    });

    $.ajax({
        url: url2,
        type: 'POST',
        async: true,
        dataType: 'html',
        data: { "Year": year },
        success: function(result) {
            $(".slider2").html(result);
            window.slider.reloadSlider({
                pager: false,
                infiniteLoop: false,
                slideWidth: 100,
                minSlides: 6,
                maxSlides: 6,
                slideMargin: 1,
                autoControls: true,
                adaptiveHeight: true,
                startSlide: 1
            });
        }
    });
}

Related


When reloading Slider, neither forward nor back has effect

Lucas Santos I am using bxSlider and in the following situation When a specific year is selected, I need to reload the month and just have the month in the clicked year value. My problem is that when reloading, I let go of the arrow controls, i.e., I can't mov

When reloading Slider, neither forward nor back has effect

Lucas Santos I am using bxSlider and in the following situation When a specific year is selected, I need to reload the month and just have the month in the clicked year value. My problem is that when reloading, I let go of the arrow controls, i.e., I can't mov

When should we use neither [Weak Self] nor [Owned Self]?

Legonaftik I read a few discussions on StackOverflow about when we should use [weak self] or [unowned self] go out of business. However, we do n't need to use them in any case , because Swift doesn't show any errors or warnings when we use them explicitly self

JavaFX - When opening a file, tabs neither show nor file content

Chris I am trying to create a text editor using JavaFX. I want to be able to open files from one window as tabs into the main window. So far I've created the necessary menu items and an options window with the function to open the file explorer to select a fil

When should we use neither [Weak Self] nor [Owned Self]?

Legonaftik I read a few discussions on StackOverflow about when we should use [weak self] or [unowned self] go out of business. However, we do n't need to use them in any case , because Swift doesn't show any errors or warnings when we use them explicitly self

When should we use neither [Weak Self] nor [Owned Self]?

Legonaftik I read a few discussions on StackOverflow about when we should use [weak self] or [unowned self] go out of business. However, we do n't need to use them in any case , because Swift doesn't show any errors or warnings when we use them explicitly self

How to position a div when it is neither specific nor important

username I am .sheltertrying to target a div class . However specificity, importantdoesn't work. Initially it worked when I tried it. .shelter{text-align: center; font-size :20px; font-weight: bold} This works to target a div, but as soon as I add: `color:

When should we use neither [Weak Self] nor [Owned Self]?

Legonaftik I read a few discussions on StackOverflow about when we should use [weak self] or [unowned self] go out of business. However, we do n't need to use them in any case , because Swift doesn't show any errors or warnings when we use them explicitly self

When should we use neither [Weak Self] nor [Owned Self]?

Legonaftik I read a few discussions on StackOverflow about when we should use [weak self] or [unowned self] go out of business. However, we do n't need to use them in any case , because Swift doesn't show any errors or warnings when we use them explicitly self

How to position a div when it is neither specific nor important

username I am .sheltertrying to target a div class . However specificity, importantdoesn't work. Initially it worked when I tried it. .shelter{text-align: center; font-size :20px; font-weight: bold} This works to target a div, but as soon as I add: `color:

JavaFX - When opening a file, tabs neither show nor file content

Chris I am trying to create a text editor using JavaFX. I want to be able to open files from one window as tabs into the main window. So far I've created the necessary menu items and an options window with the function to open the file explorer to select a fil