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
Post a Comment