What's new

Welcome to the forum 👋, Visitor

To access the forum content and all our services, you must register or log in to the forum. Becoming a member of the forum is completely free.

scroll to bottom of page with <body onload

mmacgowa

New member
Joined
May 30, 2021
Messages
1
Reaction score
0
HTML Coins
0
I am a newb. I am developing a web site that writes log entries to a simply HTML file. Various users will run PHP pages that will create entries on the log page. I want a user monitoring the log file to see the new entries made at the bottom. The entries are not occurring fast so I have created a meta tag to refresh the page every three minutes. I am not familiar with JS but was able to find a simple function that scrolls. I would like to tighten up the code. First is there a way to specify percent instead of pixels? I can specify a large pixel jump but as the log grows, I may miss the end of the file where the latest entries are. The other issue is that having a delay too long misses the refresh so there is never a scroll. The delay must be less than the three minutes before the page is redrawn. If the delay is too short, a user will not be able to scroll back in the document to review the data. I tried eliminating the delay so that the code will execute only when the page refreshes, but it did not work without the delay line.

<html><head><meta charset='UTF-8'><meta http-equiv='refresh' content='120' >
<script>
function pageScroll() {
window.scrollBy(0,10000);
scrolldelay = setTimeout('pageScroll()',10000);
}
</script>
</head>
<body onLoad="pageScroll()">
content
 

Theme customization system

You can customize some areas of the forum theme from this menu.

  • Wide/Narrow view

    You can control a structure that you can use to use your theme wide or narrow.

    Grid view forum list

    You can control the layout of the forum list in a grid or ordinary listing style structure.

    Picture grid mode

    You can control the structure where you can open/close images in the grid forum list.

    Close sidebar

    You can get rid of the crowded view in the forum by closing the sidebar.

    Fixed sidebar

    You can make it more useful and easier to access by pinning the sidebar.

    Close radius

    You can use the radius at the corners of the blocks according to your taste by closing/opening it.

  • Choose the color combination that reflects your taste
    Background images
    Color gradient backgrounds
Back