auto scroll text upwards within div.

Javascript coding ..

Moderators: macek, egami, gesf

Jason_C
New php-forum User
New php-forum User
Posts: 31
Joined: Sat Nov 18, 2006 7:32 am

auto scroll text upwards within div.

Postby Jason_C » Wed Mar 28, 2012 6:21 am

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.

User avatar
gandahar
New php-forum User
New php-forum User
Posts: 112
Joined: Tue Mar 15, 2011 4:05 am

Re: auto scroll text upwards within div.

Postby gandahar » Fri Apr 27, 2012 5:28 pm

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

Jason_C
New php-forum User
New php-forum User
Posts: 31
Joined: Sat Nov 18, 2006 7:32 am

Re: auto scroll text upwards within div.

Postby Jason_C » Sat Apr 28, 2012 12:59 am

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.

User avatar
minimihi
New php-forum User
New php-forum User
Posts: 238
Joined: Sat Apr 14, 2012 11:57 am
Location: Vilnius, Lithuania

Re: auto scroll text upwards within div.

Postby minimihi » Sat Apr 28, 2012 9:59 am

You want to have such feature without using JavaScript? :D
Well, go to dream about it.

lisajohn
New php-forum User
New php-forum User
Posts: 2
Joined: Mon Jul 02, 2012 3:15 pm
Contact:

Re: auto scroll text upwards within div.

Postby lisajohn » Sat Jul 07, 2012 1:52 pm

You have posted really a good information in this post. Thanks...

Long Island SEO


Return to “JavaScript”

Who is online

Users browsing this forum: No registered users and 2 guests