so here is the script:
<script>
var div = $("#gridline1");
$(document.body).mousemove(function(e){
if(e.pageX<630){div.animate({right:'+=1'},1);}
else {div.animate({left:'+=2'},1);}
});
</script>
Its working, but when it gets after the “else” its stop doing the “if” statement.
Please help.
I’m not sure what HTML or CSS you are using, and the effect may depend on those as well. However, I think you can just replace
right:'+=1'withleft:'-=1'. Here is a working example: http://jsfiddle.net/katylava/kagnr/