I made a small and simple code that moves a div layer 200 pixles up and down. But I want it to move the layer on click instead of mouseover. mouseleave is still ok!
How do I do a check if the layer is up or down. I want to move the layer -200px only if the layer is up 200px.
<script>
$(".block").mouseenter(function() {
$(".block").animate({"bottom": "+=200px"}, 300);
}).mouseleave(function() {
$(".block").animate({"bottom": "-=200px"}, 200);
});
</script>
use a class