target
The goal is to have a DIV container with a fixed height and width, and the HTML content in that DIV will automatically scroll vertically continuously.
Question: Basically, I created the code below, using jQuery to scroll (move) the child DIV vertically up until it goes beyond the parent field, where the animation then terminates, which calls an event handler that resets the position of the child DIV and starts the process. again.
This works fine, so the content scrolls up, leaving a blank space, and then starts again from the bottom and scrolls up.
The problem I am facing is that for this it is necessary that the content looks as if it is being repeated continuously, see the diagram below to better explain this, is there any way to do this? (I do not want to use third-party plugins or libraries other than jQuery):

(source: cameroncooke.com )
What i have so far
HTML:
<div id="scrollingContainer"> <div class="scroller"> <h1>This is a title</h1> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse at orci mi, id gravida tellus. Integer malesuada ante sit amet enim pulvinar congue. Donec pulvinar dolor et arcu posuere feugiat id et felis.</p> <p>More content....</p> </div> </div>
CSS:
#scrollingContainer{ height: 300px; width: 300px; overflow: hidden; } #scrollingContainer DIV.scroller{ position: relative; }
JavaScript:
function scroll() { if($('DIV.scroller').height() > $('#scrollingContainer').height()) { var t = $('DIV.scroller').position().top + $('DIV.scroller').height(); $('DIV.scroller').animate( { top: '-=' + t + 'px' } , 4000, 'linear', animationComplete); } } function animationComplete() { $(this).css('top', $('#scrollingContainer').height()); scroll(); }
javascript jquery jquery-ui scroll animation
Camsoft
source share