Title: jShowOff: a jQuery Content Rotator Plugin
Author: Erik Kallevig
Version: 0.1.2
Website: http://ekallevig.com/jshowoff
License: Dual licensed under the MIT and GPL licenses.
jShowOff is a jQuery plugin for creating a rotating content module. It works by creating 'slides' from the child elements (eg. <li>
) inside a specified wrapper element (eg. <ul>
) on which .jshowoff()
is invoked. It then rotates through the slides, with options for controls, links, and more. This type of module is often used to promote pages, sections, or features on a site.
To get jShowOff up and running, simply include the above files on your page, create the required slides markup and invoke the method (example below). You can use the default skin (jshowoff.css) from the demo, or restyle the elements to your liking.
The required markup for jShowOff is a parent element with one or more child elements, which are used as the 'slides'. The following is a basic example:
<div id="features">
<div><p>This is a slide!</p></div>
<div><a href="http://google.com"><img src="http://www.google.com/intl/en_ALL/images/logo.gif" alt="Google Logo" /></a></div>
</div>
<script type="text/javascript">
$(document).ready(function(){ $('#features').jshowoff(); });
</script>
jShowOff has several options for customization. Pass these settings as an object to the .jshowoff()
method like this:
$('#features').jshowoff({ speed:1500, links: false }); });
Property | Type | Default | Description |
---|---|---|---|
animatePause | boolean | true | Whether to use 'Pause' animation text when pausing. |
autoPlay | boolean | true | Whether to start playing immediately. |
changeSpeed | integer | 600 | Speed of transition in milliseconds. |
controls | boolean | true | Whether to create & display controls (Play/Pause, Previous, Next). |
controlText | object | { play:'Play', pause:'Pause', previous:'Previous', next:'Next' } | Text to use for controls (Play/Pause, Previous, Next). For multi-language support, etc. |
cssClass | string | true | Add an additional custom class to the .jshowoff wrapper. |
effect | string | 'fade' | Type of transition effect: 'fade', 'slideLeft' or 'none'. |
hoverPause | boolean | true | Whether to pause on hover. |
links | boolean | true | Whether to create & display numeric links to each slide. |
speed | integer | 3000 | Time each slide is shown in milliseconds. |
Additionally, the value of the title
attribute on the 'slide' elements will be inserted as the text for the corresponding 'slide link' in lieu of the default numeric value.
If you need help or if you've found a bug, please create an issue and I will investigate.
- Option to show slides randomly.
0.1.2
- Added
effect
option to customize transitions. Options currently include:fade
,slideLeft
ornone
. Slide effect uses new global jQuery mini-plugin,$.slideIt()
, which can be used on separately on any element. - Added
hoverPause
option to temporarily stop slide rotation on hover. $.jshowoff()
can now be invoked on any element and can take any child element as a 'slide'. Previously, only allowed<div>
's.- Added ability to customize slide link text via slide element's
title
attribute. - Added
controlText
parameter to allow custom text for controls (multi-language support, etc). - Added the
animatePause
option to specify whether to show the pause animation when pausing. - Changed a lot of dynamic markup and classes, skin CSS, and internal functions, so beware when upgrading. The plugin is still young, so it's subject to substantial change.
0.1.1
- Added error check for
changeSpeed
set less thanspeed
. - Added
cssClass
option to specify additional class on .jshowoff wrapper. - Now possible to invoke multiple instances, each with unique classes (for container, controls and links).
0.1.0
- Initial release.
jShowOff is free for personal and commercial use under the MIT/GPL license used by the jQuery core libraries. Donations are appreciated, but not required.
This plugin was written by Erik Kallevig.