Mouse trigger image, gradual effect, HTC

xiaoxiao2021-03-06  49

In this case, the fade of the picture triggered in this example is more common, but most of them are implemented with JS. You need to write a lot of events and functions to the image. If the picture is too much, the workload will be large. In order to alleviate our workload, you should use this very special thing - DHTML behavior (Behavior).

BEHAVIOR can move complex DHTML code from the page to a smaller, packaged, can be used again. Its purpose is to encapsulate specific functions in an HTC (HTML Component), which can be bundled on any element in the page. So I put all things into the HTC file, using HTC's specialty, we can easily give multiple pictures to this mouse triggering gradual effect.

Let's take a look at the specific effect demonstration: We first saw a translucent picture, when we put the mouse up, the picture was gradually displayed; the mouse was moved, the picture was getting worse.

OK. Let's take a look at the code used in inserting the picture insert:

-------------------------------------------------- -----------------------