Freelance Web Developer

Say Hi

Dec 30, 2009

Create a pointer trails with Jquery

Hope you all know how to set mouse pointer trails with your operation system. Windows user can set it from Control panel-->Printer and other Hardware-->Mouse settings-->Check the pointer trail checkbox.
I am here to demonstrate how you can set a pointer trail on your web-page with the help of Jquery

Its simple - create some img elements having pointer-image in src, and let them follow pointer-position whenever mouse move. And don't forget to fade them out slowly.

The Javascript

 $(document).ready(function() {

    $(document).mousemove(function(e) {

                //create img elements having pointer.png in their src 
                // download it from 
                pointer = $('<img>').attr({'src':'pointer.png'});

                //and append them to document
                //show them at mouse position & fade out slowly
                        tope.pageY +,    //offsets
                        lefte.pageX +2   //offsets



You can see the working demo by moving your mouse.

Labels: , ,

By :