Hello peoples,

I have mangled up the following to add fixed position left/right scroll links to a horizontal scrolling site:
Code JavaScript:
$(document).ready(function() {
  $('#container').append('<ul class="scroll_controllers"><li class="left"><a href="#" title="Scroll Left">&laquo;</a></li><li class="right"><a href="#" title="Scroll Right">&raquo;</a></li></ul>');
  $('.right a').click( function(){
    $.scrollTo( '+=600px', 900, {axis:'x'} );
    return false;
  $('.left a').click( function() {
    $.scrollTo( '-=600px', 900, {axis:'x'} );
    return false;
I'd really like to make it conditional on there being a need to scroll. Any idea what the best way to detect this would be?

Thanks in advance,