Image of the water wave reflection effect

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.