Ask your JavaScript questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

scrolling (and repeating) div with an auto-pause of 5 seconds per screen with 16 items JavaScript

  • $25

I would like to have a scrolling div with an auto-pause of 5 seconds per 16 items per screren. When the last item is reached (it also has a5-second pause) the div scrolls to the top and the process repeats over and over.

You've probably seen this in a doctors' office. Local drugstores have this for pharmacy prescriptions.

Explanation: First 16 <input> items display. Pause 2 seconds. Clear all inputs. List next 16 items. Clear all inputs. List next 16 items. Then repeat first 16 <input> items.



<div>

<div>

<input>A</input>
<input>B</input>
<input>C</input>
<input>D</input>
...etc.


</div>

</div>

I wrote this, but it only iterates once.

<script>

function dread() {var pt = 0;

while (pt < 3) {pt++; var i = 0; ratingSort(); var i = 16; ratingSort();}

}


function ratingSort() { $("input").css("border-color", "black");

for (i = 0; i <= <?php echo $limit; ?>; ) {
//for (i <= <?php echo $limit; ?>; ) {

var fullRating = toSort[i].rate;

var Name = toSort[i].name.split(" "); var lastName = Name[0]; var firstName = Name[1];

var displayName = lastName +" " + firstName + " " + toSort[i].rate;

$("#I" + (i)).val(displayName);

colorize($("#I" + (i)), toSort[i].rate);

i++;}

window.setTimeout(function(){
$("#house")[0].reset();
$("input").css("background", "inherit");
$("input").css("border-color", "transparent");
}, 3000);
}

$(document).ready(function () {
dread();
}
);


</script>

Answers (1)

2019-05-18

Arnav Joy answers:

are you still looking for help?


User180435 comments:

No, I solved it.