What are the tips for using scroll bars in HTML?

php中世界最好的语言
Release: 2018-02-12 10:15:34
Original
2595 people have browsed it

This time I will bring you some tips for using scroll bars in HTML, andnotes on using scroll bars in HTML. The following is a practical case, let’s take a look.

I would like to say that one phenomenon must be common to everyone, that is, when deleting something on a web page, the scroll bar is often still at the position before deleting the thing, instead of running to the top of the page which is very inhumane. Then How is this achieved? In fact, the method is very simple, just add MaintainScrollPositionOnPostback = "true" to the top part of the .aspx source code.

The above phenomenon was encountered when learning the Brisket News Release System. Let me share with you some other tips on using HTML scroll bars
(1) Hide scroll bars

Copy after login

(2)How to appear scroll bars in cells or layers


Copy after login

(3)Javascript changes the style of the scroll bar in the frame, such as changing the color or changing it to a flat effect Wait

Copy after login

Instructions:

scrollbar-3dlight-color:color; Set or retrieve the scroll bar bright border color;
scrollbar-highlight-color:color; Set or retrieve the scroll bar 3D The bright edge color of the interface;
scrollbar-face-color:color; Set or retrieve the color of the scroll bar 3D surface;
scrollbar-arrow-color:color; Set or retrieve the color of the scroll bar direction arrow; when scrolling This property is invalid when the bar appears but is unavailable;
scrollbar-shadow-color:color; Sets or retrieves the dark edge color of the scroll bar 3D interface;
scrollbar-darkshadow-color:color; Sets or retrieves the scroll bar dark color Border color;
scrollbar-base-color:color; Set or retrieve the base color of the scroll bar. Other interface colors will be automatically adjusted accordingly.
scrollbar-track-color:color; Set or retrieve the color of the scroll bar's dragging area
Note:
color is the color code you want to set, which can be hexadecimal, such as #FF0000, OK It is expressed in RGB, such as rgb(255,0,255); when setting the scroll bar style, it is not necessary to use all the attributes for it to take effect.
(4) Positioning of page elements in javascript
clientX, clientY are the current position of the mouse relative to the web page. When the mouse is located in the upper left corner of the page, clientX=0, clientY=0;
offsetX, offsetY are the mouse The current position relative to a certain area in the web page. When the mouse is located in the upper left corner of this area on the page, offsetX=0, offsetY=0;
screenX, screenY are the positions of the mouse relative to the user's entire screen;
x, y are the current position of the mouse relative to the current browser
scrollLeft: Set or get the distance between the left edge of the object and the leftmost end of the currently visible content in the window (because of the generation of the scroll bar, the current page It can be seen that the content is uncertain).
scrollTop: Set or get the distance between the top of the object and the top of the visible content in the window.
left: X coordinate of the object relative to the page.
top: Y coordinate of the object relative to the page
(5) Shield selection, right click, etc.
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

    
  
1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ
1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ 2234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ 3234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ 4234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ 5234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ 6234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ 7234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ 8234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ 9234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ 0234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ 2234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ
1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ 2234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ 3234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ 4234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ 5234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ 6234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ 7234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ 8234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ 9234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ 0234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ 2234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ
Copy after login

The use of scroll bars is very common, and there is quite a lot of related knowledge about it. I hope you can You can continuously learn and summarize, so that your learning ability and learning efficiency can be improved to a certain extent.

I believe you have mastered the methods after reading these cases. For more exciting information, please pay attention to php Chinese website Other related articles!

Related reading:

How to implement the input text box and img verification code

htmlHow to implement mouse hover Prompt A tag content

How to use the trigger method to pop up the file selection dialog box without clicking the file type input

The above is the detailed content of What are the tips for using scroll bars in HTML?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!