The content of this article is about the fade-in and fade-out effect of JavaScript uniform motion (code). It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.
When doing p or picture fade-in and fade-out, we mainly use the transparency style filter: alpha(opacity:30) is compatible with ie, opacity:0.3 is compatible Firefox chrome.
When the motion fades in and out, the timer setInterval;clearInterval;
When js operates to fade in and out, use the following form to modify the transparency op.style. filter="alpha(opacity:" alpha ")";op.style.opacity=alpha/100;
Note: transparency cannot be judged directly in js, we use the alpha parameter Do the comparison and finally apply it to the object.
Related recommendations:
javascript uniform motion to achieve sidebar sharing effect ( Code)
js to realize uniform fade-in and fade-out of images
Use jQuery to realize advertising scrolling and fade-in and fade-out
The above is the detailed content of Javascript uniform motion to achieve fade-in and fade-out effect (code). For more information, please follow other related articles on the PHP Chinese website!