I've been trying to create an effect using jquery that when you run the mouse over a div, the whole body moves, leaving a trail along the points it passed. I created a function that enabled the whole body to move, but I couldn't find a way to leave the trail. I tried to use .clone()
, but as I'm a beginner with jquery, I wasn't able to do it right. Could anyone help me with this issue. Here's the code I'm using to move the body:
<script type="text/javascript">
$(document).ready(function() {
$("div").mouseover(function() {
$("body").animate({
margin: 50,
})
});
$("div").mouseout(function() {
$("body").animate({
margin: 0,
})
});
});
</script>
Thanks a lot!