Skip to content

Commit

Permalink
disabled controls if only one page - #49
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Wanderski committed Mar 3, 2013
1 parent a0aaf84 commit e32daa8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions jquery.bxslider.js
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,10 @@
slider.controls.prev.removeClass('disabled');
slider.controls.next.removeClass('disabled');
}
// if slider has only one page, disable controls
}else if(getPagerQty() == 1){
slider.controls.prev.addClass('disabled');
slider.controls.next.addClass('disabled');
}
}

Expand Down
Loading

1 comment on commit e32daa8

@Temaruk
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix will not be effective if infiniteScroll is disabled.

It either should be inside the if statement above it: if(!slider.settings.infiniteLoop && slider.settings.hideControlOnEnd){ ...here... },

Or should be a completely separate one:

if(!slider.settings.infiniteLoop && slider.settings.hideControlOnEnd){ ... }

if(getPagerQty() == 1){
  slider.controls.prev.addClass('disabled');
  slider.controls.next.addClass('disabled');
}

Please sign in to comment.