Reader
  • Home
  • About
  • Deals
  • Services
  • Contact

Image Reflection with jQuery, MooTools and script.aculo.us

Last updated on October 6th, 2009 by Gabriel Livan

jquery-reflection

Reflection.js for jQuery is an improved version of the reflexion.js script rewritten for the JQuery library. It’s easy to integrate, as you only need 2 files to call: the (latest) JQuery Library file and the Reflexion JS File. You can add instantaneous reflexion effects to your images in modern browsers in less then 2KB.

Some advantages of this new script:

* The reflection appear instantly under each image, after each image is loaded, without having to wait for all images to load and apply the reflection for all at the same time.
* The new code has a smaller size than the original reflection.js, being optimized for JQuery.
* The code has a few bug fixes that the original script doesn’t have. It usually works better.

[Go to Project Page | Download | View Demo]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<html>
 <head>
  <title>Image Reflexion with JQuery</title> 
<script type="text/javascript" src="js/jquery-1.2.6.min.js"></script>

<script type="text/javascript" src="js/jquery.reflection.js"></script>
<script type="text/javascript">
<!--
// Code moves from jquery.reflection.js
jQuery(function($) {
$("img.reflect").reflect({/* Put custom options here */});
});
//-->
</script>
 </head>

<body>
<img alt='' src='images/js-logo.png' class='reflect'><br />
<img alt='' src='images/image-one.png' class='reflect'><br />
<img alt='' src='images/image-two.png' class='reflect'>
</body>
</html>

As you can notice a CSS class named ‘reflect’ is applied to the images. This uses the default reflection parameters:

$("img.reflect").reflect({/* Put custom options here */});

If you need to remove reflexion you can call the unreflect() method on a JQuery selector:

$("#photo_id_here").unreflect();

More information regarding the usage of this script can be found on the script’s page.

mootools-reflection

Reflection.js for MooTools is an improved version of the reflexion.js script rewritten for the MooTools JavaScript framework. The script has the same image reflection effect and features as the Reflection.js for JQuery.

[Go to Project Page | Compatibility | Usage | Download | View Demo]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<html>
 <head>
  <title>Image Reflection with MooTools</title> 
<script type="text/javascript" src="js/mootools.js"></script>

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

<script type="text/javascript">
<!--
// Code moved from mootools.reflection.js
window.addEvent("domready", function() {
	$$("img").filter(function(img) { 
return img.hasClass("reflect"); 
}).reflect({/* Put custom options here */});
});
//-->

</script>
 </head>
<body>

<img alt='' src='images/mootools.jpg' class='reflect'><br />
<img alt='' src='images/image-one.png' class='reflect'><br />
<img alt='' src='images/image-two.png' class='reflect'>

</body>
</html>

script.aculo.us Reflector is a script that uses opacity-based fades and works on any background, including image-based backgrounds.

Click here to view the script in action (check the source of the page to understand how it works).

Filed Under: JavaScript, jQuery, MooTools

About Me

Gabriel LivanHey, there! I'm Gabriel Livan, Web Developer, Blogger and Internet Marketer. I love making fast, secure and scalable web applications, running and travelling around the world. I blog about WordPress, site speed & security and quality tools for web professionals. Read more

What are you looking for?

Categories

  • AJAX (22)
  • Deals (10)
  • Design (30)
  • eBooks (2)
  • Flash (19)
  • Freebies (11)
  • General (62)
  • Giveaways (1)
  • Graphics (27)
  • HTML & CSS (35)
    • Frameworks (9)
  • JavaScript (160)
    • Frameworks (8)
    • jQuery (89)
    • MooTools (14)
  • Page Loading Speed (2)
  • Photoshop (3)
  • PHP (113)
  • Reviews (8)
  • SEO (6)
  • Statistics (2)
  • Web Tools (13)
  • WordPress (27)
    • Plugins (15)
    • Snippets (4)
    • Tools (2)
    • Tutorials (6)

Copyright © 2026 · BitRepository.com - All Rights Reserved

  • Home
  • About
  • Contact