Image Reflection by javascript

I have made one reflection on image using neondragon’s javascript code.

Image reflection by javascript test

Image reflection by javascript test

here i gave the source code of javascript and html file also. for adding reflection you have to add just the class value. here i used class=”reflect”. if your image alreday has class vaule so, you can add reflection separated by space like class=”imageBox reflect”

<img  class=”reflect” style=”width: 384px; height: 276px;”  alt=”” title=”sweet baby” src=”babypic.jpg”>

if you want to change this class name just edit addReflections function156 line from reflection.js

var rimages = document.myGetElementsByClassName(‘reflect’);

i put the default height and opacity in the reflection.js file you can change it  or dynamically it can be change this way – class=”reflect rheight60 ropacity45″

—————————–  Reflection test.html

<!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”>
<html>
<head>
<meta
content=”text/html; charset=ISO-8859-1″
http-equiv=”content-type”>
<title>Reflection test</title>
</head>

<body>

<script
type=”text/javascript” src=”reflection.js”></script>

<img class=”reflect” style=”width: 384px; height: 276px;” alt=”” title=”sweet baby” src=”babypic.jpg”>
</body>
</html>

Leave a Reply

Your email address will not be published. Required fields are marked *