1. Overview
The image has the effect of the reflection of the water waves will be very new, such as preview of the blog site someone to set their own photos as a reflection of the water waves. Running this instance, after the page is successfully loaded, a picture of the reflection of the water wave is displayed on the page.
2. Technical Highlights
The main application of CSS style in the wave filter to implement, the syntax format is as follows:
Filter:wave (add=true(false), frep= frequency, lightstrength= enhanced light efficiency, phase= offset, strength= strength)
Parameter description:
U Add: Indicates whether the object is scrambled with a ripple style and evaluates to TRUE or FALSE.
V Freq: Indicates the frequency at which ripples are generated, that is, specifies how many ripples are required on an object.
W Lightstrength: Represents the generation of ripple-enhanced luminous effects ranging from 0 to 100.
X phase: Used to set the offset at which the sine wave starts, the universal value of this value is 0, and the value range is between 0 and 100. This value represents the start of the offset as a percentage of the wavelength, for example, a value of 25 o'clock, which represents the sine wave starting from the direction of 90 degrees (360*25%).
3. Concrete implementation
Implementation of the water wave reflection effect JavaScript function, the key code:
<script language= "JavaScript" > Function Map () { setinterval ("img1.filters.wave.phase+ =10 ","); } if (document.all) { document.write (' <center></Center>"; = map; } </script>
4. Summary
The first is to add a picture to the page, and then create a picture dynamically through the custom JavaScript function map (), and finally, in the custom function, set the filter for the dynamically created image to the wave reflection effect.
Image of the water wave reflection effect