grayscalejs
v1.0.3
Published
Add a GrayScale filter to images
Downloads
7
Maintainers
Readme
Add a GrayScale filter to images
Install
You can get it on npm.
npm install grayscalejs --save
Usage
- GrayScale all images in webpage
<img src="image.jpg"/> <button onclick="grayscale()">Click Me</button>
- GrayScale all images with a specific ID
<img id="myImage" src="image.jpg"/> <button onclick="grayscaleById("myImage")">Click Me</button>
- GrayScale all images with a specific Class
<img class="myImage" src="image.jpg"/> <button onclick="grayscaleByClass("myImage")">Click Me</button>
- Reset all GrayScaled images in webpage
<img src="image.jpg"/> <button onclick="grayscaleClear()">Clear Me</button>
- Reset all GrayScaled images with a specific ID
<img id="myImage" src="image.jpg"/> <button onclick="grayscaleClearById("myImage")">Clear Me</button>
- Reset all GrayScaled images with a specific Class
<img class="myImage" src="image.jpg"/> <button onclick="grayscaleClearByClass("myImage")">Clear Me</button>
- Toggle all images in webpage between GrayScale and Color
<img src="image.jpg"/> <button onclick="grayscaleToggle()">Click Me</button>
- Toggle all images with a specific ID in a webpage between GrayScale and Color
<img id="myImage" src="image.jpg"/> <button onclick="grayscaleToggleById("myImage")">Click Me</button>
- Toggle all images with a specific Class Name in a webpage between GrayScale and Color
<img class="myImage" src="image.jpg"/> <button onclick="grayscaleToggleByClass("myImage")">Click Me</button>