JavaScript-Xeyes

jQuery xeyes

This is a simple jQuery plugin that is meant to emulate the classic xeyes program. While it doesn’t have many native uses, some very creative people managed to incorporate it into their projects. If you have any questions or need help using this script, contact @felix_mc.

Additional documentation here.

Examples

External

Basic Usage

The plugin requires two block level elements, the eye and the iris. For the plugin to work properly, it also requires that they each have proper dimensions defined using CSS.

<div class="eyeball">
    <div class="iris"></div>
</div>
.eyeball {
    width: 110px;
    height: 150px;
    background: #fff;
    margin-right: 10px;
}
 
.iris {
    width: 25px;
    height: 25px;
    background: #000;
}

Finally, to initialize the plugin, simply call the js function on the iris element:

$('.iris').xeyes();

The plugin will automatically assume that its immidiate parent will be used as the eyeball element. The eyeball class was only required for the styling.

Configuration

All of the following are optional. You can use them to further customize this plugin.