When studying the beef brisket press release system today, the beef brisket teacher talked about some knowledge about scroll bars. Not much mentioned, but only involved part of the knowledge about scroll bars. If you want to study in depth, these are not enough. You have to collect some relevant knowledge by yourself.
I said that a phenomenon must be common for everyone. When deleting some things on a web page, the scrollbar is often still deleting the position before the thing, rather than running to the top of the page in a very inhumane manner. So how is this implemented? In fact, the method is very simple. You only need to add MaintainScrollPositionOnPostback =true to the top part of the source code of .aspx. See the picture below:
The above phenomenon was encountered when learning the beef brisket press release system. Let me share with you some other tips on using html scroll bars.
(1) Hide scrollbar
<bodystyle=overflow-x:hidden;overflow-y:hidden>
(2) How to appear in a cell or layer
<divstyle=width:200px;height:200px;overflow-x:auto;overflow-y:auto;></div>
(3) JavaScript changes the style of the scroll bar in the frame, such as changing the color, changing it to a flat effect, etc.
<STYLE>
BODY {SCROLLBAR-FACE-COLOR: #ffcc99;
SCROLLBAR-HIGHLIGHT-COLOR: #ff0000;
SCROLLBAR-SHADOW-COLOR: #ffffff;
SCROLLBAR-3DLIGHT-COLOR: #000000;
SCROLLBAR-ARROW-COLOR: #ff0000;
SCROLLBAR-TRACK-COLOR: #dee0ed;
SCROLLBAR-DARKSHADOW-COLOR: #ffff00;}
</STYLE>
illustrate:scrollbar-3dlight-color:color; set or retrieve the scrollbar bright border color;
scrollbar-highlight-color:color; set or retrieve the bright edge color of the scrollbar 3D interface;
scrollbar-face-color:color; set or retrieve the color of the scrollbar 3D surface;
scrollbar-arrow-color:color; Set or retrieve the color of the scrollbar direction arrow; this property is invalid when the scrollbar appears but is not available;
scrollbar-shadow-color:color; set or retrieve the dark edge color of the scrollbar 3D interface;
scrollbar-darkshadow-color:color; set or retrieve the scrollbar dark border color;
scrollbar-base-color:color; Set or retrieve scrollbar reference color. Other interface colors will be automatically adjusted accordingly.
scrollbar-track-color:color; set or retrieve the drag area color of the scrollbar
Remark:The color code you want to set for you can be in hexadecimal, such as #FF0000, which can be represented in RGB, such as rgb(255,0,255); when setting the scroll bar style, you don't need to use all attributes to take effect.
(4) Page element positioning in javascript
clientX and clientY are the current position of the mouse relative to the web page. When the mouse is in the upper left corner of the page, clientX=0, clientY=0;
offsetX and offsetY are the current position of the mouse relative to a certain area in the web page. When the mouse is located in the upper left corner of this area in the page, offsetX=0, offsetY=0;
screenX and screenY are the position of the mouse relative to the entire screen of the user;
x and y are the current position of the mouse relative to the current browser
scrollLeft: Set or get the distance between the left boundary of the object and the leftmost end of the currently visible content in the window (because there is a scroll bar, the current visible content on the page is uncertain).
scrollTop: Sets or gets the distance between the top of the object and the top of the visible content in the window.
left: The X coordinate of the object relative to the page.
top: The Y coordinate of the object relative to the page
(5) Block selection, right-click, etc.
<body oncontextmenu=self.event.returnValue=falseonselectstart=return false>
The following small example is to automatically set the scroll bar according to the size of the form
Copy the code