The style is used to limit the DIV style and add scroll bars. I won’t say much about this
The key point is actually very simple. The last two lines of Javascript are all it takes. Only the last line works:
obj.scrollTop=obj.scrollHeight *(Math.random());
obj.scrollTop: The position of the scroll bar from the top
obj.scrollHeight: The height of the flow area
Math.random(): Get a random number
Very Simple, someone may need it, just take it, haha
PS: IE6 / IE7 / FF2 passed the test
When IE7 was tested locally, the position of the scroll bar was different every time it was opened, but there was no change when refreshing. Once on the website, it will be normal
The code is as follows: