engmmagdy / jQuery.BlackAndWhite

Clientside grayscale images on any browser

Home Page:http://gianlucaguarini.github.io/jQuery.BlackAndWhite/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This plug-in can easily convert every colored image (in an html page) into a B&W greyscale image. Read the plugin API on here http://gianlucaguarini.github.io/jQuery.BlackAndWhite/.

#Usage

1 Include the plug into the page:

<script src="js/jQuery.BlackAndWhite.js"></script>

2 Set the image wrappers using the css:

.bwWrapper {
    position:relative;
    display:block;
}

3 Initialize the plug in:

$('.bwWrapper').BlackAndWhite({
    hoverEffect : true, // default true
    // set the path to BnWWorker.js for a superfast implementation
    webworkerPath : false,
    // to invert the hover effect
    invertHoverEffect: false,
    // this option works only on the modern browsers ( on IE lower than 9 it remains always 1)
    intensity:1,
    speed: { //this property could also be just speed: value for both fadeIn and fadeOut
        fadeIn: 200, // 200ms for fadeIn animations
        fadeOut: 800 // 800ms for fadeOut animations
    },
    onImageReady:function(img) {
    	// this callback gets executed anytime an image is converted
    }
});

IMPORTANT

the script works only for the images hosted on the same server in which the page is loaded!

Plugin Showcase

About

Clientside grayscale images on any browser

http://gianlucaguarini.github.io/jQuery.BlackAndWhite/

License:Other