Sometimes when we do dynamic growth div, we usually append the content to the bottom of the div, but this will bring a problem that is quite painful, that is, the newly added content will be hidden at the bottom, for exampleHow can we make scrollbar automatically move to the bottom? This requires the help of js. If the div id is myDiv, the native js implementation is as follows:Copy codeThe Code is as follows:Var myDiv = document. getElementById ('myd
, gwl_style) and(Ws_hscroll or ws_vscroll) ThenSetwindowlong (WND, gwl_style,Getwindowlong (WND, gwl_style)And not (ws_hscroll or ws_vscroll ));End;End;Result: = callwindowproc (F, WND, MSG, wparam, lparam );End;
I clipped this code from a larger project, so lets hope I did notCreate errors in the process. What this Code does is to subclassClient window the API way. It stores the old window function intoGwl_userdata field of the window structure since it is needed inReplacement window function,
window visual range3 varheight=getclientheight (),4 //window scroll bar height5theight=getscrolltop (),6 //Height of window visual range7rheight=getscrollheight (),8 //height of scroll bar distance from bottom9bheight=rheight-theight-height;Ten Onedocument.getElementById (' show '). Innerhtml= ' At this time the browser visible area height is: ' +height+ ' Bheight; A}JS Gets the height of the window scrollbar, the
Implement a callback function: (a function that involves animation to execute a statement)$ ("P"). Hide (+,function() {alert ("the paragraph is now hidden");});Write for yourself:Write yourself a jquery implementation when the scrollbar is sliding to a position to move toward the middle
= 50;Changereg (bright);BreakCase 4:Bright = 75;Changereg (bright);BreakCase 5:Bright = 100;Changereg (bright);BreakDefault:
Changereg (bright);Break
}
Cdialog::onhscroll (Nsbcode, NPOs, Pscrollbar);}
Nsbcode: Represents the direction of scrolling.
NsbcodeTable name user scrolling code for requirements, parameters are one of several of the following:Sb_left Scroll to the leftSb_endscroll Scroll to the endSb_lineleft Scroll LeftSb_lineright Scroll to the rightSb_pageleft Scroll one page to the l
CSS3 custom scroll bar style, css3 custom scroll bar
Do you think that the original scroll bar that comes with the browser is not beautiful? At the same time, you can see that the custom scroll bars of many websites appear high-end. Even the chrome32.0 Development Board discards the original scroll bar, which is more beautiful. Then how does the webkit browser cu
Original: http://www.chinaz.com/design/2011/0406/170105.shtmlI believe many people have encountered in the design of the custom scroll bar style, before I was trying to persuade the designer to accept the browser's own scroll bar style, but this can only avoid or solve the problem, recently encountered in the project, just to summarize. Of course, the scroll bar style that is compatible with all browsers currently does not exist.The scroll bar style u
certainly not complete, * * Custom scroll bar style, you must have a scroll bar to be * *. So we have to add some CSS to this block to make it appear scrollbars, otherwise it is not effective. The added style is simple, defining a wide or high or wide definition, and then defining a overflow value of auto. This causes a scroll bar to appear if the content exceeds the specified width height. Cases:Width:100px;height:100px;overflow:auto;After doing thi
Scroll bar custom styles for Google Chrome and opera browsers650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/89/87/wKiom1gW1b6B7hdZAABGaUfMtsM212.png "title=" Scrollbarparts.png "alt=" Wkiom1gw1b6b7hdzaabgaufmtsm212.png "/>::-webkit-scrollbar//scroll bar integral section, where the properties are Width,height,background,border (just like a block-level element), and so on. (position 1)::-webkit-
I believe many people have encountered in the design of custom scroll bar style, before I was trying to convince designers to accept the browser with the scroll bar style, but this can only circumvent or solve the problem, recently encountered in the project, just to sum up. Of course, the scroll bar styles that are compatible with all browsers do not currently exist.
The scroll bar style under IE
IE is the first to provide scroll bar style support,
I believe many people have encountered in the design of custom scroll bar style, before I was trying to convince designers to accept the browser with the scroll bar style, but this can only circumvent or solve the problem, recently encountered in the project, just to sum up. Of course, the scroll bar styles that are compatible with all browsers do not currently exist.
The scroll bar style under IE
IE is the first to provide scroll bar style support,
button and track fragments. Indicates whether the object (Button track fragment) is placed in front of the slider: the end//end pseudo-class applies to button and track fragments. Indicates whether the object (Button track fragment) is placed behind the slider:d Ouble-button//double-button Pseudo-class applies to button and track fragments. Determines whether the position of the end of the track is a pair of buttons. That is, the track fragment is next to a pair of buttons. : Single-button//
-dimensional scroll bar */
Scrollbar-darkshadow-color: color;/* color of the Shadow outside the three-dimensional scroll bar */
Scrollbar-track-color: color;/* stereo scroll bar background color */
Scrollbar-base-color: color;/* base color of the scroll bar */
You can also define cursor to define the mouse gesture of the scroll bar.
Here, danger developed
in the previous article, we introduced the CSS Settings div scroll bar style, we all know that when the content outside the container, the container will appear scroll bar, its own scroll bar sometimes does not meet our aesthetic requirements, Then we can use CSS pseudo-class to implement the custom of the scroll bar.
First we need to understand the scroll bar. The scroll bar from the appearance is composed of two parts: 1, you can slide the part, w
track, scroll bar middle part 6. ::-webkit-scrollbar-corner corner, where the vertical scroll bar intersects the horizontal scrollbar 7. ::-webkit-resizer two scroll bars at the intersection of a small control that is used to drag the resizing of an element The scroll bar consists of the following chart:Here is an implementation of a simple set of custom scro
Android custom controls-custom properties, android Custom Controls
Reprinted please indicate the source:Http://blog.csdn.net/allen315410/article/details/39343401
When customizing android components, apart from using Java to build components, we sometimes need to declare some "attributes" for the project to use, so what is the component property?For example, when
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.