Skip to content

An open-source jQuery plugin to easily and semantically add captions to images.

Notifications You must be signed in to change notification settings

intermedion/captionjs

 
 

Repository files navigation

Documentation

Below is the basic setup for caption.js. For more info, please see captionjs.com.

$(window).load(function() {
    $('img.caption').captionjs({
		'class_name'      : 'captionjs', // Class name for each <figure>
		'schema'          : true,        // Use schema.org markup (i.e., itemtype, itemprop)
		'mode'            : 'default',   // default | stacked | animated | hide
		'debug_mode'      : false,       // Output debug info to the JS console
		'force_dimensions': true,        // Force the dimensions in case they cannot be detected (e.g., image is not yet painted to viewport)
		'is_responsive'   : false,       // Ensure the figure and image change size when in responsive layout. Requires a container to control responsiveness!
		'inherit_styles'  : false        // Have the caption.js container inherit box-model properties from the original image
	});
});

About

An open-source jQuery plugin to easily and semantically add captions to images.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • CSS 72.8%
  • HTML 18.4%
  • JavaScript 8.8%