Skip to content

43081j/pixelate.js

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

pixelate.js

pixelate.js is a simple library and jQuery plugin to pixelate any set of images and optionally reveal them on hover.

Demo here

Usage

pixelate.js can be used with jQuery:

$('img').pixelate();

Or without via HTML data attributes:

<img src="test.jpg" width="200" height="200" data-pixelate>

Options

  • value The percentage of pixelation to perform, a value between 0 and 1
  • reveal Reveal the image on hover and remain revealed if clicked
  • revealonclick Reveal the image on click. When combined with reveal, it will remain revealed after being clicked.

These options may be specified by data tags, like so:

<img src="img.jpg" data-pixelate data-value="0.5" data-reveal="false">

or by jQuery/JavaScript:

$('img#myimage').pixelate({ value: 0.5, reveal: false });

License

MIT

About

jQuery plugin to pixelate images and, optionally, reveal on hover

Resources

Stars

Watchers

Forks

Packages

No packages published