在DIV-Javascript中添加AutoScroll

How do I add an auto scroll function to the below file?

By auto scroll I mean it automatically scrolls to the bottom within the scrollable area and then start from the top again.

I tried different JavaScript code, but none of it worked.

<div class="box">
    <div class="box-heading"><?php echo $heading_title; ?></div>
    <div class="box-content">
        <?php foreach ($all_news as $news) { ?>
            <div align="center">
            </div>
            <div style="
                width: 98%;
                height: 200px;
                overflow-y:auto;">

                <script type="text/javascript" src="http://domain.com/file.php"></script>
                <div id="feedmain" class="feed11"><a href="http://www.domain.com">PFeed</a></div>
                </div>
            </div>
        <?php } ?>
    </div>
</div>

The file.php we are loading is only an HTML table.

You can use overflow-y:scroll instead of overflow-y:auto.

Use CSS

.divClass{
    overflow:scroll;
}

This one worked for me.

var objDiv = document.getElementById("your_div");
objDiv.scrollTop = objDiv.scrollHeight;