Public methods

JS:

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

$('#slider-next').click(function(){
  slider.goToNextSlide();
  return false;
});

$('#slider-count').click(function(){
  var count = slider.getSlideCount();
  alert('Slide count: ' + count);
  return false;
});

HTML:

<ul class="bxslider">
  <li><img src="/images/730_200/tree_root.jpg" /></li>
  <li><img src="/images/730_200/hill_fence.jpg" /></li>
  <li><img src="/images/730_200/houses.jpg" /></li>
</ul>

<p><a href="" id="slider-next">Click me to go to the next slide</a><br />
<a href="" id="slider-count">Click me to see the total slide count</a></p>

Note that the .bxSlider() call must be assigned to a variable (var slider in this example) to call any public methods.

Add sliders to any website
with just two lines of code
Check out sliderui.com!