MyBB Tutorials
Appearing Scroll to Top
Submitted by Blowjob, 23-01-2015, 07:02 AM, Thread ID: 628
Thread Closed
Users browsing this thread: 1 Guest(s)
<script type="text/javascript">
jQuery(function($) {
$("#backtop").hide();
$(window).scroll(function () {
if ($(this).scrollTop() > 400) {
$('#backtop').fadeIn(200);
} else {
$('#backtop').fadeOut(200);
}
});
$('.go-top').click(function () {
$('html,body').animate({
scrollTop: 0
}, 1000);
return false;
});
});
</script>
<div id='backtop'>
<a class='go-top' href='#top' title='Back to Top'><img src="BUTTON IMAGE" /></a>
</div>
#backtop {
position: fixed;
bottom: 50px;
right: 10px;
margin: 0;
padding: 0;
width: 36px;
height: 36px;
z-index: 100;
}
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript">
jQuery.noConflict();
</script>
Loading Info...