Eigene Scroll-Funktion für Mouseover


function scrlReinitialise(scrlApi)
{
  scrlApi.reinitialise();
  return false;
}

function scrollX(dir, scrlApi)
{
  scrlApi.scrollByX(dir);
}

//wird aufgerufen beim initialisieren
$(window).load(function(){
  $('.scrlcontainer').each(function(idx, element) {
    //Instanzenverwaltung
    new scrlPaneClass(element);
  });
});

//die Funktion wird als Klasse benutzt, damit mehrere Instanzen der Scroll-Pane mit dem mouseover benutzt werden können
function scrlPaneClass(inScrlContainer){
/* ohne var schlägt die Klasse fehl, da nur eine Instanz der Variable erzeugt wird */
  var delayTime = 50;
  var leftIntervalId = -1;
  var rightIntervalId = -1;
  var element = null;
  var scrlApi = null;

  var oWidth = $(inScrlContainer).children('.objlistwidth').text();
  $(inScrlContainer).find('.objlist').width(oWidth + 'px');

  element = $(inScrlContainer).find('.scroll-pane').jScrollPane(
    {showArrows: false,
     horizontalGutter: 0,
     verticalGutter: 0,
     verticalDragMinHeight: 40,
     verticalDragMaxHeight: 40,
     horizontalDragMinWidth: 34,
     horizontalDragMaxWidth: 34});
  scrlApi = element.data('jsp');
  if(scrlApi == null){
    return;
  }
  $(inScrlContainer).children('.leftscroll').mouseover(
    function(){
      if(leftIntervalId == -1){
      leftIntervalId = window.setInterval(function() { scrollX(-28, scrlApi); }, delayTime);
    }
  });
  $(inScrlContainer).children('.leftscroll').mouseout(
    function(){
      if(leftIntervalId != -1){
      clearInterval(leftIntervalId);
      leftIntervalId = -1;
    }
  });
  $(inScrlContainer).children('.rightscroll').mouseover(
    function(){
      if(rightIntervalId == -1){
      rightIntervalId = setInterval(function() { scrollX(28, scrlApi); }, delayTime);
    }
  });
  $(inScrlContainer).children('.rightscroll').mouseout(
    function(){
      if(rightIntervalId != -1){
      clearInterval(rightIntervalId);
      rightIntervalId = -1;
    }
  });
  $(window).bind('resize', function(){
    scrlReinitialise(scrlApi);
  });
}