$(document).ready(function(){
   $("#text-slider").slider({
    animate: true,
    change: handleTextSliderChange,
    slide: handleTextSliderSlide
  });
});

function handleTextSliderChange(e, ui)
{
  var maxScroll = $("#text-scroll").attr("scrollHeight") - $("#text-scroll").height();
  $("#text-scroll").animate({scrollTop: ui.value * (maxScroll / 100) }, 1000);
}

function handleTextSliderSlide(e, ui)
{
  var maxScroll = $("#text-scroll").attr("scrollHeight") - $("#text-scroll").height();
  $("#text-scroll").attr({scrollTop: ui.value * (maxScroll / 100) });
}

$(document).ready(function(){
  $("#content-slider").slider({
    animate: true,
    change: handleSliderChange,
    slide: handleSliderSlide
  });
});

function handleSliderChange(e, ui)
{
  var maxScroll = $("#content-scroll").attr("scrollWidth") - $("#content-scroll").width();
  $("#content-scroll").animate({scrollLeft: ui.value * (maxScroll / 100) }, 1000);
}

function handleSliderSlide(e, ui)
{
  var maxScroll = $("#content-scroll").attr("scrollWidth") - $("#content-scroll").width();
  $("#content-scroll").attr({scrollLeft: ui.value * (maxScroll / 100) });
}