I’d like to create an if – else condition system which allows scrolling up only when the top margin is different than 0. I’ll use the .animate action in jquery to create an animation.
$('#up-arrow a').click(function(){
if('#slider'.css(margin-top)!='0px')
$('#slider').animate({'margin-top':'+=320px'});
else
Can someone please correct this for me? It works without the if, but after I added the if-else it does nothing.
Instead of this
Try this