Documentation

Plugins:reflect

From jQuery JavaScript Library

Jump to: navigation, search

Reflect jQuery

Get it here: Reflect jQuery

This plugin is based on reflection.js ( http://cow.neondragon.net/stuff/reflection/ ), but rather than using the prototype class selector, it uses jQuery. It includes support for inline options for compatibility with reflection.js markup, but also handles options in the jQuery way.

Usage

Add the script tags for jquery and jquery.reflect.js to your page. Add classes to the images you want to be reflected so you can select them. Then attach the reflect method to any images you want to be reflected:

$(document).ready(function() {
	$('img.reflect').reflect();
})

Options

There are two ways to do options. One is the jQuery way:

$('img.reflect').reflect({height: 0.3, opacity: 0.6});

The height and opacity should be decimals between 0 and 1.

The other method for adding options is mostly present for compatibility with markup that was created for reflection.js. It invovles adding extra classes to your images:

<img src="something.jpg" class="reflect rheight30 ropacity60" />

To enable this method, set inline to true:

$('img.reflect').reflect({inline: true});