jQuery(document).ready(function() {
  //$('a.slider-play').addClass('playing');
  $('.slider-text').hide();
  setTimeout(function() {
	  $('.slider-text').show();
  }, 500);
  $('#slider').before('<div class="slidernav">').cycle({
	fx: 'fade',
	speed: 1000,
    timeout: 5000, 
    before: onBefore, 
    after: onAfter,
  });
});
// När bilden rullar in
function onBefore() { 
  //.slider-text
  $(".slider-text").animate({"top": "+=250px"}, 500);
  setTimeout(function() {
	  $('.slider-text').hide();
  }, 500)
  $(".slider-text").animate({"top": "-=250px"}, 0);
} 

// När bilden rullar ut
function onAfter() { 
  //.slider-text
  $(".slider-text").animate({"top": "-=250px"}, 0);
  $('.slider-text').fadeIn(250);
  $(".slider-text").animate({"top": "+=250px"}, 500);
}
