The style is used to limit the DIV style and add a scroll bar.
The key is actually very simple. The last two lines of Javascript work only on the last line:
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 (): obtain a random number.
It's very simple. Someone may need it. Take it for use. Haha
PS: IE6/IE7/FF2 passed the test
During the local test of IE7, the position of the scroll bar is different only when it is opened each time, but the refresh is not changed, but it will be normal after it is placed on the website.
The Code is as follows:
<Li> 01 </li> <li> 02 </li> <li> 03 </li> <li> 04 </li> <li> 05 </li> <li> 06 </li> <li> 07 </li> <li> 08 </li> <li> 09 </li> <li> 10 </li> <li> 11 </li> <li> 12 </li> <li> 13 </li> <li> 14 </li> <li> 15 </li> <li> 16 </li> <li> 17 </li> <li> 18 </li> <li> 19 </li> <li> 20 </li> <li> 21 </li> <li> 22 </li> <li> 23 </li> <li> 24 </li> <li> 25 </li> <li> 26 </li> <li> 27 </li> <li> 28 </li> <li> 29 </li> <li> 30 </li> <li> 31 </li> <li> 32 </li> <li> 33 </li> <li> 34 </li> <li> 35 </li> <li> 36 </li> <li> 37 </li> <li> 38 </li> <li> 39 </li> <li> 40 </li> <li> 41 </li> <li> 42 </li> <li> 43 </li> <li> 44 </li> <li> 45 </li> <li> 46 </li> <li> 47 </li> <li> 48 </li>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]