I have a Scroll to top button with a Fixed position. I want this button to slide in from the bottom of the screen after you scrolled 400px. i can get it to work with fadein and fadeout. This is the code of the button.
<a href="#top" id="scrolltop"><img src="images/upbutton.png" alt="scroll to top"/></a>
#scrolltop {
position:fixed;
height:38px;
width:38px;
background-color:#444;
right:15px;
bottom:15px;
z-index:100;
}
$(document).scroll(function() {
var y = $(this).scrollTop();
if (y > 1000) {
$('#scrolltop').animate({bottom: 100});
} else {
$('#scrolltop').animate({bottom: -100});
}
});