Page 1 of 1

auto scroll text upwards within div.

Posted: Wed Mar 28, 2012 6:21 am
by Jason_C
How would I get the text inside a DIV to auto scroll.

I wish to place loads of customer reviews in a DIV, but only have the div say 100px high and maybe 100px wide and have the text scroll upwards which would show the rest of the other reviews in the div, then once the div is at the end of the list it would continue from the top and still scroll around upwards like there was no break in the text.

Would I be right in saying that I need to use JavaScript to get this to work? If so does anyone have any suggestions where I might get the code ? Been looking around for a little bit but only finding out how to place a scroll bar in a div and not how to get the div to automatically scroll on its own.

Re: auto scroll text upwards within div.

Posted: Fri Apr 27, 2012 5:28 pm
by gandahar
try with jQuery, it's very simple to animate scroll

example:

function goToByScroll(id){
$('html,body').animate({scrollTop: $("#"+id).offset().top},'slow');
}
goToByScroll("anchorId");

you can put an anchor and pass the id to the function

Re: auto scroll text upwards within div.

Posted: Sat Apr 28, 2012 12:59 am
by Jason_C
yes everyone is suggesting this one, but i wanting to have the site JS free so it caters for everyone, because the non JS downgrade is not there at all if they have it turned off. and the page look really bad otherwise.

Re: auto scroll text upwards within div.

Posted: Sat Apr 28, 2012 9:59 am
by minimihi
You want to have such feature without using JavaScript? :D
Well, go to dream about it.