Center an image outside of a container
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist
src
.gitignore
LICENSE
bower.json
gulpfile.js
package.json
readme.md

readme.md

Center Image

This is a simple jQuery plugin to center an image outside of a container by using negative margin.

Usage

$('img.popout').centerImg({
  container: $(".content"), // The container element. Used in calculating width
  maxWidth: 600 // The max width of the image. Default is $("body").innerWidth()
});