html - Leave a body trail with jquery -


i've been trying create effect using jquery when run mouse on div, whole body moves, leaving trail along points passed. created function enabled whole body move, couldn't find way leave trail. tried use .clone(), i'm beginner jquery, wasn't able right. me issue. here's code i'm using move body:

<script type="text/javascript"> $(document).ready(function() {  $("div").mouseover(function() {     $("body").animate({         margin: 50,     })       });  $("div").mouseout(function() {     $("body").animate({         margin: 0,     }) });        });       </script> 

thanks lot!

quite interesting problem. have coded following: http://jsfiddle.net/3pq8e/

here i'm adding border , removing - creating trail.

$("div").mouseover(function() {     $("div").animate({     margin: 25,     borderleftwidth: "50px",     bordertopwidth: "50px",   }, 1500 );      });  $("div").mouseout(function() {     $("div").animate({         margin: 0,     borderleftwidth: "2px",     bordertopwidth: "2px",     }) }); 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -