tags:

views:

189

answers:

2

Is there a way to control the amount that the browser is scrolled in jquery? For example, if I wanted to add content to the bottom of a page and have it always be at the bottom, with everything else scrolling up (like a terminal)

+1  A: 
$(window).scroll(function(e) {
    e.preventDefault();
    //check browser scroll here and do whatever you want...
    //$(window).scrollTop();
});

update

Oh and I just found this is possible:

$(window).scrollTo(xxx); //xxx = '100px', '10%' or 44 or '+=10px'
Ropstah
+3  A: 

This very website(StackOverflow) has the answer ... Look in the source

$.scrollTo("#answers-table", 400);

In

<script type="text/javascript">
$().ready(function() {
    $(".answer-pager a, .tabs-answer-user a").click(function() {
        var url = $(this).attr('href');

        $.post(url, function(result) {
            var domelement = $(result);
            $("#answers-table").html(domelement);
        });

        $.scrollTo("#answers-table", 400);

        return false;
    });

});
</script>

And including

<script src="/content/js/third-party/jquery.scrollTo-1.3.3-min.js" type="text/javascript">
Aiden Bell