Jquery 如何控制Bxslider中滑块的垂直方向?
我在我的网页上使用Jquery插件。我将滑动模式设置为“垂直”,但默认的滑动方向是从下到上移动,但我想将其更改为从上到下移动。但是我想不出来。任何建议都将不胜感激为此,您必须更改此Jquery 如何控制Bxslider中滑块的垂直方向?,jquery,bxslider,Jquery,Bxslider,我在我的网页上使用Jquery插件。我将滑动模式设置为“垂直”,但默认的滑动方向是从下到上移动,但我想将其更改为从上到下移动。但是我想不出来。任何建议都将不胜感激为此,您必须更改此插件的核心代码 插件中的 var setSlidePosition = function(){ // if last slide, not infinite loop, and number of children is larger than specified maxSlides if(slider
插件的核心代码
插件中的
var setSlidePosition = function(){
// if last slide, not infinite loop, and number of children is larger than specified maxSlides
if(slider.children.length > slider.settings.maxSlides && slider.active.last && !slider.settings.infiniteLoop){
if (slider.settings.mode == 'horizontal'){
// get the last child's position
var lastChild = slider.children.last();
var position = lastChild.position();
// set the left position
setPositionProperty(-(position.left - (slider.viewport.width() - lastChild.width())), 'reset', 0);
}else if(slider.settings.mode == 'vertical'){
// get the last showing index's position
var lastShowingIndex = slider.children.length - slider.settings.minSlides;
var position = slider.children.eq(lastShowingIndex).position();
// set the top position
setPositionProperty(-position.top, 'reset', 0);//Change this line
}
// if not last slide
}else{
// get the position of the first showing slide
var position = slider.children.eq(slider.active.index * getMoveBy()).position();
// check for last slide
if (slider.active.index == getPagerQty() - 1) slider.active.last = true;
// set the repective position
if (position != undefined){
if (slider.settings.mode == 'horizontal') setPositionProperty(-position.left, 'reset', 0);
else if (slider.settings.mode == 'vertical') setPositionProperty(-position.top, 'reset', 0);
}
}
}
更改行:
setPositionProperty(-position.top, 'reset', 0);
至
setPositionProperty(position.top, 'reset', 0);
然后尝试使用为此,您必须更改此插件的核心代码
插件中的
var setSlidePosition = function(){
// if last slide, not infinite loop, and number of children is larger than specified maxSlides
if(slider.children.length > slider.settings.maxSlides && slider.active.last && !slider.settings.infiniteLoop){
if (slider.settings.mode == 'horizontal'){
// get the last child's position
var lastChild = slider.children.last();
var position = lastChild.position();
// set the left position
setPositionProperty(-(position.left - (slider.viewport.width() - lastChild.width())), 'reset', 0);
}else if(slider.settings.mode == 'vertical'){
// get the last showing index's position
var lastShowingIndex = slider.children.length - slider.settings.minSlides;
var position = slider.children.eq(lastShowingIndex).position();
// set the top position
setPositionProperty(-position.top, 'reset', 0);//Change this line
}
// if not last slide
}else{
// get the position of the first showing slide
var position = slider.children.eq(slider.active.index * getMoveBy()).position();
// check for last slide
if (slider.active.index == getPagerQty() - 1) slider.active.last = true;
// set the repective position
if (position != undefined){
if (slider.settings.mode == 'horizontal') setPositionProperty(-position.left, 'reset', 0);
else if (slider.settings.mode == 'vertical') setPositionProperty(-position.top, 'reset', 0);
}
}
}
更改行:
setPositionProperty(-position.top, 'reset', 0);
至
setPositionProperty(position.top, 'reset', 0);
然后尝试使用定位设置滑块箭头的位置。例如,我们将滑块“箭头”定位设置为绝对、上箭头顶部、下箭头底部。您可以使用定位设置滑块箭头的定位。例如,我们将滑块“arrow”定位设置为绝对、上一个箭头顶部、下一个箭头底部。您可以设置自动放映幻灯片过渡的方向(autoDirection:'prev')
$('.bxslider').bxslider({
模式:“垂直”,
幻灯片摘要:20,
米斯利德斯:4,
maxSlides:4,
第一,,
是的,
autoDirection:'prev'/*您可以设置自动放映幻灯片过渡的方向(autoDirection:'prev')
$('.bxslider').bxslider({
模式:“垂直”,
幻灯片摘要:20,
米斯利德斯:4,
maxSlides:4,
第一,,
是的,
自动方向:“上一个”/*