Tuesday, March 06, 2007

The other day I was surfing the web, and off of a link on digg I ran across  "Reflections.js". It is a brilliant little piece of code that I've used on a site I'm building for a friend. I'm sure by now you all know that I am a big fan of apple, and the new album feature in itunes, where you see the album cover and it looks like it is being reflected on a glass surface, is something I find very pleasing to the eye. However to do a large site requires either a ton of time in photoshop, or something brilliant like Reflections.js. This is a terribly easy to use. You simply call the javascript into the page.

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

Now all you have to do is in your image tag add "class=reflect" and your image has a beautiful reflection.

<img src="myimage.jpg" alt="" class="reflect rheight75 ropacity65">

Add "rheight75 ropacity65" to the end of the reflect class call and now you've set the height of the reflection and the opacity of it too. Simply Brilliant!


Happy Coding :-D
3/6/2007 8:15:57 AM (Pacific Standard Time, UTC-08:00)  #    Comments [1]