Skip to content

Jthomas54/imageReveal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

imageReveal

imageReveal allows you to take a single img tag and turn it into an image with an overlay that can display a header and a body.

####How to use

There are two ways to use imageReveal, you can declare the title and text content inline in the attributes of the tag or you can use the options object to pass in the contents.

imageReveal looks at the title attribute when populating the title of the overlay and the data-content attribute when determining the body content. HTML is acceptable in the data-content attribute.

Below are the acceptable options that imageReveal currently accepts:

  • height - this sets the height & max-height of the widget*
  • width - this sets the width & max-width of the widget*
  • opacity - the opacity to set the image to when then overlay is being revealed
  • duration - the duration the animation should take to complete
  • title - the title of the overlay (imageReveal will override this in favor of the title attribute)
  • content - this body content of the overlay (imageReveal will override this in favor of the data-content attribute)

*Note: the height and width properties default to the value of "auto". When using "auto", imageReveal will get the height and width from the img it is applied to

######Example Usage: HTML: <img src="http://placekitten.com/200/200" title="A kitten" data-content="This text will be displayed to the user on hover" />

JS: $("img").imageReveal();

####Demo

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published