Help: Scroll to Bottom of Page code
3 posters
Page 1 of 1
Help: Scroll to Bottom of Page code
i'm using this code for my back to top button:
code in my site description -->
CSS -->
and javascript -->
now, my members who are using their celfones to access the forum are requesting for the opposite - a scroll to the bottom of the page button...
is it possible to create a code for that similar to the above-posted codes? thanks in advance to those who'll help...
code in my site description -->
- Code:
<div id=backtotop><img src=http://i78.servimg.com/u/f78/14/05/87/26/back-t10.png /></div>
CSS -->
- Code:
#backtotop {
bottom: 50px;
color: #FFFFFF;
cursor: pointer;
display: none;
font-size: 14px;
opacity: 0.4;
position: fixed;
text-align: center;
z-index: 999;
right: 30px;
border-radius : 8px;
-webkit-border-radius : 8px;
-moz-border-radius : 8px;
}
#backtotop:hover {
opacity : 0.8;
}
and javascript -->
- Code:
$(function() {
$(window).scroll(function() {
if($(this).scrollTop() != 0) {
$('#backtotop').fadeIn();
} else {
$('#backtotop').fadeOut();
}
});
$('#backtotop').click(function() {
$('body,html').animate({scrollTop:0},800);
});
});
now, my members who are using their celfones to access the forum are requesting for the opposite - a scroll to the bottom of the page button...
is it possible to create a code for that similar to the above-posted codes? thanks in advance to those who'll help...
leonidas- Forumember
- Posts : 28
Reputation : 6
Language : English
Re: Help: Scroll to Bottom of Page code
You don't even need JavaScript for that... lol.
- Code:
<a href="#bottom">
Re: Help: Scroll to Bottom of Page code
Ultron's Vision wrote:You don't even need JavaScript for that... lol.scrolls to the bottom of the page.
- Code:
<a href="#bottom">
that's it? where's that supposed to go? anyway, im looking for something that functions just like the code on top, only the opposite...
leonidas- Forumember
- Posts : 28
Reputation : 6
Language : English
Re: Help: Scroll to Bottom of Page code
Anywhere, just as normal button.
Wherever you can insert HTML, that will work (except if you have something with an id of "bottom" in your page).
Wherever you can insert HTML, that will work (except if you have something with an id of "bottom" in your page).
Re: Help: Scroll to Bottom of Page code
- Code:
<a href="#bottom" id="hulk">Click me to go to bottom</a>
- Code:
$("#hulk").click(function() {
$("html, body").animate({ scrollTop: $(document).height() }, "slow");
});
Re: Help: Scroll to Bottom of Page code
Well, okay, you want it to scroll smoothly.
That is HTML's solution for it and it will just instantly go down to the bottom.
You can use something like that, though.
And then in a new jQuery script.
That is HTML's solution for it and it will just instantly go down to the bottom.
You can use something like that, though.
- Code:
<a href="#bottom">Click to go to the bottom of the page (works even without JavaScript!)</a>
And then in a new jQuery script.
- Code:
jQuery('a[href="#bottom"]').click(function(e){
e.preventDefault();
e.stopPropagation();
jQuery('html,body').animate({scrollTop:jQuery(document).height()},"slow"});
});
Similar topics
» page scroll code
» User Cannot Scroll Page + Sudden Page Format Change
» Code for scroll
» How do I do a scroll code?
» Scroll Box Code
» User Cannot Scroll Page + Sudden Page Format Change
» Code for scroll
» How do I do a scroll code?
» Scroll Box Code
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum