Jquery Continuous vertical text scroller that refreshes content

1.9k views Asked by At

I have been trying to adapt JQuery to do what I want, and after spending hours trying to find the answer, am appealing to my betters. I am using vticker to create a continuously scrolling display. This information updates every 60 - 90 seconds, but can vary in length. So I'm looking for one of two things:

1) Display first iteration of A-Z data, and when Z starts to scroll on the screen, immediately grab the next iteration of A-Z data, so iteration #2 of A immediate follows iteration #1 of Z.

2) Simply reload the next iteration of data after a timed interval, but not display it until the previous iteration has completed.

I am pretty adept in PHP, so I can either have the data returned from a PHP script, or from a static HTML file which my PHP script creates.

UPDATE:

Here is my code. It mostly works - except that if we're in the middle of a list it will refresh those entries on the spot. For example, assume my list is A-Z, but only F-N are on the screen. When the refresh fires, it updates the F-N on my screen rather than waiting until the W-X-Y-Z is making its way up from the bottom.

Code:

<script>
$(function(){
    var $scroller = $("#scroller");
    $scroller.vTicker('init', {height: 350, showItems: 2, speed: 600, pause: 0, mousePause: false });
    $("#scroller").load("stand1.php"); // /Main_Page #jq-p-Getting-Started li");

    $(document).ready(function() {
$.ajaxSetup({ cache: false }); // This part addresses an IE bug.  without it, IE will only load the first number and will never refresh
setInterval(function() {
$('#scroller').load('stand1.php');
}, 30000); // the "3000" here refers to the time to refresh the div.  it is in milliseconds. 
}); 


});
</script>
1

There are 1 answers

1
mod On

I have used DataTables to give infinite scroll to my tables. Also it gives you four options to load data into tables. And the best thing about "DataTables" is you can theme it using jQueryUI.