stevenwanderski / bxslider-4

Responsive jQuery content slider
Other
4.22k stars 1.84k forks source link

Reload Slider with custom pager (method1) #331

Open tukao89 opened 11 years ago

tukao89 commented 11 years ago

Hi, I tried reload my slider by using:

 var slider = $('#MySlider').bxSlider({
                    mode: 'fade',
                    captions: true,
                    adaptiveHeight: true,
                    pagerCustom: '#MyPagerId'
                });
$('#EffecList').off('change').on('change', function () {
                    var easing = $(this).val();
                    slider.reloadSlider({
                        mode: 'fade',
                        useCSS: false,
                        easing: easing,
                        captions: true,
                        adaptiveHeight: true,
                        pagerCustom: '#MyPagerId',
                        speed: 2000
                    });
                });

No error found but pager is removed. How can i keep pager visible?

ryanburnette commented 10 years ago

I had to come back and edit this comment. It's not a bug. The reloadSlider method is meant to accept a settings object. Put your settings into an object for passing both to your original initialization and your reload.

var settings = {}
  , slider
  ;

settings = {
  pagerCustom = '#pager'
};

slider = $('.bxslider').bxSlider(settings);

slider.reloadSlider(settings);

This should retain your settings after reloads.

This issue can be closed.

ryanburnette commented 10 years ago

Ack I guess I spoke too soon. Even if you pass the pagerCustom option the whole element is removed from the DOM when you run the reloadSlider method.

wojtas commented 8 years ago

Still a bug. Reloading the slider removes the custom pager element from the DOM.