This article mainly shares ideas and methods for implementing browser scroll bar compatibility with IE, Firefox and chrome using native JavaScript, which has some reference value, let's take a look at the following small series. Today we will share with you the browser scroll bar I made myself. We know that it is quite good to use css to customize the scroll bar, although css can be customized to change the style of the chrome browser scroll bar, css can also change the color of the IE browser scroll bar. However, css can only change the color of IE, and CSS cannot change the style and color of Firefox. So it can only be implemented through JavaScript. There are also plug-ins. I will share my thoughts on using native JavaScript. First, let's see the effect in the previous figure:
The idea of JavaScript implementation is to simulate the browser's own scroll bar. The idea I made was to first place the entire document in a container, and then adjust the top value of p in the container to implement the rolling effect layout as follows:
Although many people talk about the super performance of quantum computing, such as one second to complete the current supercomputer computing tasks for several years, but so far did not create a true sense of the quantum computer, one of the very important reason is that, The state of particles used in quantum computation is not stable, and any electromagnetic or physical interference can easily disrupt its work. The state of the Mayola fermion is very stable, which makes it a perfect choice for making quantum computers. Six months ago in the laboratory of Shanghai Jiaotong University, Jia Jinfeng successfully captured it. Speaking of the scene, Jia Jinfeng said: "In fact, I started to hear the Mayolana fermions, I think this thing may not be done 20 years out. Using a special material preparation method, Jia Jinfeng's research team has grown topological insulators on the superconductors with thickness of 5 nanometers. The topological superconductor materials are prepared and finally the Mayolana fermions are found at the interface of the topological superconductors. The mysterious particles were captured 80 years, but also let Jia Jinfeng more firm with its confidence in the manufacture of quantum computers. Speaking of the future of the plan, Jia Jinfeng said: "I hope to within a few years to do the topological quantum bit!" (Before) the world has not, so if we cut into this from the point, we are the same with the world The starting line, for our country, this is able to catch up with the footsteps of quantum computing, a starting point.
Define the slider and slide bar first, and then define a box for content loading. The layout is very simple. Set the body overflow to hidden to hide the default scroll bar.
The main idea is: slider moving distance/slider rolling range = Content Rolling distance/Content Rolling height; slider moving distance is the distance to be dragged after the mouse is pressed,
The scroll height of the content is the total height of the content minus the height of the visible area. In addition, the overall height of the scroll bar is the height of the visible area, the height of the slider = the height of the visible area/the total height of the content * the height of the visible area. The last step is to determine whether the browser is Firefox.