I have a function that I want to loop. I found the easiest way to do this was using setInterval. When I tried this the function only runs once. Please advise where I am going wrong. Cheers
function empMove() { $('.emp-wrap').css('margin-top', '-100px')};
setInterval(empMove, 2000);
I have a div with multiple rows and I want to show only one at a time, hence I am decreasing the margin-top each time.
The current code sets the top margin to -100px. Try
function empMove() { $('.emp-wrap').css('margin-top', '-=100')};