1 add jQuery and plug in to the page
<
script
src
=
"js/jquery.min.js"
></
script
>
<
script
src
=
"js/jQuery.BlackAndWhite.js"
></
script
>
2 Add this class to the wrapper of the image, want make in Black and white
<
div
class
=
"bwWrapper"
>
<
img
src
=
"path/to/your/image"
width
=
"image width"
height
=
"image height"
/ >
</
div
>
3 Set the wrapper in this is from the CSS:
.bwWrapper {
position
:
relative
;
display
:
block
;
}
4 Initialize the plug in on window load (no $ (document). Ready ()):
$ (window). Load (function(){ $('. Bwwrapper '). BlackAndWhite ({hovereffect:true,//default True //set the path to bnwworker.js for a superfast implementationWebworkerpath:false, //For the images with a fluid width and heightResponsive:true, //This option works with the modern browsers (on IE lower than 9 it remains always 1)Intensity:1, speed: {//This property could also is just speed:value for both FadeIn and FadeOutFADEIN:200,//200ms for fadeIn animationsfadeout:800//800ms for FadeOut animations } });});
JQuery Black and white plugin