This article describes the JS implementation of cool water wave text effects. Share to everyone for your reference. The implementation methods are as follows:
Copy Code code as follows:
<title>js to achieve cool wave text effects </title>
<body bgcolor= "#000000" onload= "if (document.all) wave ()" >
<center>
<div id= ' water ' style= ' position:relative;width:400px;height:150px;font-family:verdana;font-size:50px;color:# 8080FF ' >
</div>
</center>
<script language= "JavaScript" >
<!--
if (document.layers) {//if the NS
Alert ("Your browser does not support this special effect"); Make a hint
}
else//otherwise (not NS)
if (document.all) {//and is IE words
var step=3; Set the step to change the effect
var xstep=0;
var msg= ' Welcome to <br> cloud-dwelling community <br>jb51.cn ';
WATER.INNERHTML=MSG//Set effect layer content
Function Wave () {
This is used to set the style of the layer in which the phase property of the filter is dynamically set according to the Xstep value.
Document.all.water.style.filter= ' Wave (freq=3, strength=5, phase= ' +xstep+ ', lightstrength=45, Add=0, enabled=1) ';
Xstep+=step;
Change the Xstep value based on the step value so that the ripple angle changes slightly the next time the layer style is refreshed
Timer=settimeout (' Wave () ', 10);/Set the time delay for the next change
}
}
-->
</script>
I hope this article will help you with your JavaScript programming.