In order to achieve a more vivid effect, you can fade or fade an element, in either case, the transparency of the element is changed over time. jquery provides 3 and fade-related functions:
Fadein () makes a hidden element fade into view. First, the space that the element occupies appears on the page (which may mean that other elements on the page are to be moved), and then the elements become visible gradually. This function has no effect if the element is already visible on the page. If a speed value is not provided, the element fades in (400 milliseconds) using the general setting.
fadeout () hides it by making a visual element fade out of sight like a phantom. If the element is hidden on the page, the function has no effect, as it does with the Fadein () function. If a speed value is not provided, the element fades out at a rate of 400 milliseconds.
Fadetoggle () combines the effects of fading and fading. If the element is currently hidden, it fades into view, and if it is currently visible, the element fades out of view. You can use this function to have a cue box appear on the page or disappear from the page. For example, suppose you have a button that displays the word "instructions" on it. When a visitor clicks the button, a div with a description fades in, and clicking the button again will leave the description out of view. To have the prompt fade in or out every half second, you can write code like this:
$ (' #button '). Click (function () {
$ (' #instructions '). Fadetoggle (+);
}) ;//end Click
Fadeto () works slightly differently than the other two effect functions. It dilutes the image to a certain degree of transparency. For example, you can make the image fade to translucent. Unlike other effects, you must provide a speed value. In addition, a value between 0~1 is provided to represent the transparency of the element. For example, to dilute all paragraphs to 75% transparency, you can write code like this:
$ (' P '). Fadeto (' normal ',. 75);
This function changes the transparency of an element, regardless of whether the element is visible or not. For example, suppose you want to dilute one of the currently hidden elements to 50% transparency. Then, if you use Show () or Fadein () to display the element, it will appear with 50% transparency. Similarly, if you hide a semitransparent element and then display it, its transparency settings are restored.