$(document).ready(function(){
$("#content-slider").slider({
    animate: true,
    change: handleSliderChange,
    slide: handleSliderSlide,
    orientation: 'vertical',
    value: 100
  });
});

function handleSliderChange(e, ui)
{
  var maxScroll =
  $("#content-scroll").attr("scrollHeight") -
  $("#content-scroll").height();
  $("#content-scroll").animate({scrollTop:
  (100-ui.value) * (maxScroll / 100) }, 1000);
}

function handleSliderSlide(e, ui)
{
  var maxScroll =
  $("#content-scroll").attr("scrollHeight") -
  $("#content-scroll").height();
  $("#content-scroll").attr({scrollTop:
  (100-ui.value) * (maxScroll / 100) });
}
