You can use clearQueue()
to stop the animation
clearQueue() : Stop the remaining functions in the queue
jsFiddle here
HTML
<div class="box"></div>
<button id="restartTransition">Click Me</button>
CSS
.box{
opacity: 0.8;
position: absolute;
left: 0;
top: 5%;
background: #505060;
border-radius: 1px;
box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.2);
margin: -16px 0 0 -16px;
width: 32px;
height: 32px;
z-index: 2;
}
jQuery
$(document).ready(function(){
$("#restartTransition").on("click", function(){
$('.box').clearQueue().transition({ x: '0px' },10);
$('.box').transition({ x: '350px' },5000);
});
});