jQuery Captify Simple Animated Image Captions

Using the ALT-attribute method:


Caption Text

DIV-linked-by-REL-attribute Method:

Whatever caption you like

How do I use it?

// all of these options are... optional
// ---
// speed of the mouseover effect
speedOver: 'fast',
// speed of the mouseout effect
speedOut: 'normal',
// how long to delay the hiding of the caption after mouseout (ms)
hideDelay: 500,
// 'fade', 'slide', 'always-on'
animation: 'slide', 
// text/html to be placed at the beginning of every caption
prefix: '', 
// opacity of the caption on mouse over
opacity: '0.7',    
// the name of the CSS class to apply to the caption box
className: 'caption-bottom',
// position of the caption (top or bottom)
position: 'bottom',
// caption span % of the image
spanWidth: '100%'

This javascript above should be wrapped in a tag and then be placed in the of your document, after you’ve included jquery.js and captify.tiny.js.

Note: Also, you need to copy-and-paste the necessary items out of the sample stylesheet into your own website’s stylesheet. When you open it up, you’ll see what needs to be copied right away.

One side-effect of the captions is that the captified images become wrapped in divs that float left. If you have text clinging to their right side, clear the float by adding this line right after the image:

If you don’t want to take that route, just take out this block from the stylesheet, and that’ll do the trick too 🙂

.caption-wrapper {
float: left;

Download: http://www.htmldrive.net/items/download/297

Be Sociable, Share!

Leave a comment