JavaScript implements image reflection-reflex. js and css implements text reflection
It is easy to use JavaScript to add reflection effects to images. You can add class = "reflect" to images that require reflection effects. For more information, see.
Current version: reflex. js 1.5
Mainstream browsers: Mozilla Firefox 1.5 +, Opera 9 +, Safari and IE6 +
Principle: re-draw an image using canvas to display the reflection effect
The usage is simple:
First of all, you must reference this js:
<script type="text/javascript" src="reflex.js"></script>
Then add the initialization class reflex to the corresponding img label class name.
First, only three app initialization images are displayed:
<div class="demo"></div><div class="demo"></div><div class="demo"></div>
The effect is as follows:
This script uses the CSS class to control the reflection. The class attribute is briefly introduced as follows:
- Idistance: sets the reflected pixel height-min = 0 max = 100 default = 0
- Iheight: sets the percentage height of reflection-min = 10 max = 100 default = 33
- Iopacity: sets the transparency of reflection-min = 0 max = 100 default = 33
- Iborder: Set the border's pixel width-min = 0 max = 100 default = 0
- Icolor: Set the border color-min = 000000 max = ffffff default = f0f4ff
- "Itiltright" or "itiltnone" or "itiltleft": sets the direction of the image, which is the right, unchanged, and left.
We try to change the transparency:
<div class="demo"><a href="img/album.jpg"></a></div><div class="demo"><a href="img/album.jpg"></a></div><div class="demo"><a href="img/album.jpg"></a></div>
The effect is as follows:
Then we change the other classes:
<div class="demo"></div><div class="demo"></div><div class="demo"></div>
The effect is as follows:
The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.