JavaScript to achieve image reflection effect-reflex.js_jsp programming

Source: Internet
Author: User
Tags reflection

JavaScript to the image of the use of reflection effect is very simple, give you need to add reflection effect of the picture plus class= "reflect", the need for small partners can refer to.

Current version: Reflex.js 1.5

Applicable mainstream browsers: Mozilla Firefox 1.5+, Opera 9+, Safari and ie6+

Principle: To repaint the picture through canvas, display the reflection effect

The use method is simple:

First of course to quote this JS:

<script type= "Text/javascript" src= "Reflex.js" ></script>

You can then add the initialization class reflex to the corresponding IMG tag class name.

 
 

We'll show you only three pictures of the application initialization class:

<div class= "Demo" ></div> <div
Class= "Demo" ></div> <div class="
Demo "></div>

The effect is as follows:

This script uses CSS classes to control the reflection, and the class attribute is briefly described as follows:

    • Idistance: Sets the pixel height of the reflection-min=0 max=100 default=0
    • Iheight: Set the percentage height of the reflection-min=10 max=100 default=33
    • Iopacity: Set the transparency of the reflection-min=0 max=100 default=33
    • Iborder: Sets the pixel width of the border-min=0 max=100 default=0
    • Icolor: Set the color of the border-min=000000 max=ffffff default=f0f4ff
    • "Itiltright" or "Itiltnone" or "Itiltleft": Sets the direction of the picture, which is the right, constant, and left.

We're trying 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 class= "demo" ></div> <div class=
"demo" ></div>"

The effect is as follows:

The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.

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.