I have implemented a code snippet on my blog to go "Back to top" using a combination of HTML, CSS, and JavaScript. Now I am looking to add functionality for the opposite action, which is to "Go to Bottom". The code for going back to the top looks like this:
HTML
<div id="back-top">
<a href="#top">
<img src="http://4.bp.blogspot.com/-6KDdSchHT18/Uvxj4CJipXI/AAAAAAAAE4k/wyk-sSq5gbc/s1600/Back-to-top.png"/><br/>Top</a></div>
CSS
#back-top a{text-decoration: none;}
#back-top {
color: #ff0000;
position: fixed;
bottom: 25px;
left: 125px;
font-weight: bold;
}
JavaScript
$(function (){
$(window).scroll(function (){
if ($(this).scrollTop() > 300){
$('#back-top').fadeIn();
}
else{
$('#back-top').fadeOut();
}
});
How can I create an alternative option for this?