Hover Caption (HCaption.js)




Markup example

This example uses all default settings.
      <a href="#myToggle" class="panel">
        <img src="http://placehold.it/470x300/f1f1f1/aaa&text=Example" />
      </a>
      <div id="myToggle" class="cap-overlay hide">
        <h5>Cupcakes</h5>
        <div class="content">
          Name: cupcakes.png<br />
          Photography: Ryun Shofner<br />
          <a href="javascript:void(0)" class="button small"><i class="icon-edit"></i> Edit</a> 
          <a href="javascript:void(0)" class="button small"><i class="icon-remove"></i> Delete</a>
        </div>
      </div>
    
Cupcakes
Name: cupcakes.png
Photography: Ryun Shofner
Edit Delete

Fade Effect

This example demonstrates the fade effect setting.
Config
      $(selector).hcaptions({
        effect: "fade"
      });
    
Magic Attributes
      cap-effect="fade"
    
Cupcakes
Name: cupcakes.png
Photography: Ryun Shofner
Edit Delete

Slide direction: left

This example demonstrates the slide effect.
Config
      $(selector).hcaptions({
        effect: "slide",
        direction: "left"
      });
    
Magic Attributes
      cap-effect="slide"
      cap-direction="left"
    
Cupcakes
Name: cupcakes.png
Photography: Ryun Shofner
Edit Delete

Slide direction: right

This example demonstrates the slide effect.
Config
      $(selector).hcaptions({
        effect: "slide",
        direction: "right"
      });
    
Magic Attributes
      cap-effect="slide"
      cap-direction="right"
    
Cupcakes
Name: cupcakes.png
Photography: Ryun Shofner
Edit Delete

Slide direction: top

This example demonstrates the slide effect.
Config
      $(selector).hcaptions({
        effect: "slide",
        direction: "top"
      });
    
Magic Attributes
      cap-effect="slide"
      cap-direction="top"
    
Cupcakes
Name: cupcakes.png
Photography: Ryun Shofner
Edit Delete

Slide direction: bottom

This example demonstrates the slide effect.
Config
      $(selector).hcaptions({
        effect: "slide",
        direction: "bottom"
      });
    
Magic Attributes
      cap-effect="slide"
      cap-direction="bottom"
    
Cupcakes
Name: cupcakes.png
Photography: Ryun Shofner
Edit Delete

Slide speed: 1000

This example demonstrates the animation speed.
Config
      $(selector).hcaptions({
        effect: "slide",
        speed: "1000"
      });
    
Magic Attributes
      cap-effect="slide"
      cap-speed="1000"
    
Cupcakes
Name: cupcakes.png
Photography: Ryun Shofner
Edit Delete

Slide speed: 100

This example demonstrates the animation speed.
Config
      $(selector).hcaptions({
        effect: "slide",
        speed: "100"
      });
    
Magic Attributes
      cap-effect="slide"
      cap-speed="100"
    
Cupcakes
Name: cupcakes.png
Photography: Ryun Shofner
Edit Delete

Configuration

Most settings can be set with the plugin or with "magic attributes" you can override the settings for individual captions. A magic attribute is a attribute prepended with cap- for example to override the effect setting, you would use cap-effect="fade" as a html attribute in your tags.
Name Type Description Default
data_selector string Selector for caption content .cap-overlay
width integer Overlay width full width
height integer Overlay height full height
overlay_x string Horizontal position for the overlay [center, left, right] center
overlay_y string Vertical position for the overlay [center, top, bottom] center
overlay_bg string Background css for overlay inherits
overlay_opacity integer Opacity of overlay 1
effect string Effect for overlay [fade, slide, show/hide] slide
speed integer Animation speed in ms 400
direction string Direction of overlay [top, bottom, right, left] top
zindex integer Base Z-Index 2
onshow function Callback fired when caption is shown none
onhide function Callback fired when caption is hidden none

© 2013 HumboldtWeb.com, Inc. All rights reserved.

Fork me on GitHub