Jquery. Is there a way to start an animation and stop that animation using the same button?
js:
$('<div>').css({
'width':'200px',
'height':'200px',
'background':'red'
}).appendTo('body')
$('<button>').appendTo('body').text('Click').click(function(){
$('div').animate({
'height': '250px'
})
})
$('button').on('click',function(){
$('div').animate({'height':'350px'})
})