jquery bxslider memory slide on window resize reloadShow()函数
为项目()使用BxSlider jQuery内容滑块。我在调整窗口大小时使用“reloadShow()函数,以便内容重新对齐到中心 reloadShow()函数正在工作,但每次它都会将我的幻灯片重置为第一张幻灯片。相反,我希望记住它所在的幻灯片并重新加载到该幻灯片 这是我的JS:jquery bxslider memory slide on window resize reloadShow()函数,jquery,window-resize,bxslider,Jquery,Window Resize,Bxslider,为项目()使用BxSlider jQuery内容滑块。我在调整窗口大小时使用“reloadShow()函数,以便内容重新对齐到中心 reloadShow()函数正在工作,但每次它都会将我的幻灯片重置为第一张幻灯片。相反,我希望记住它所在的幻灯片并重新加载到该幻灯片 这是我的JS: $(function(){ // assign the slider to a variable slider = $('#slider').bxSlider( { contro
$(function(){
// assign the slider to a variable
slider = $('#slider').bxSlider(
{
controls: false,
auto: false
});
// assign a click event to the external thumbnails
$('.thumbs a').click(function()
{
var thumbIndex = $('.thumbs a').index(this);
// call the "goToSlide" public function
slider.goToSlide(thumbIndex);
// remove all active classes
$('.thumbs a').removeClass('pager-active');
// assisgn "pager-active" to clicked thumb
$(this).addClass('pager-active');
// very important! you must kill the links default behavior
return false;
});
// assign "pager-active" class to the first thumb
$('.thumbs a:first').addClass('pager-active');
$(window).resize(function(e)
{
slider.reloadShow();
});
});
也许这个链接的答案会帮助你:祝你好运!也许这个链接的答案会帮助你:祝你好运!