<script type="text/javascript"> function animacja1(){ $('#a1').cycle({ fx: 'custom', sync: 0, cssBefore: { top: 0, left: 232, display: 'block' }, animIn: { left: 0 }, animOut: { top: 232 }, delay: -1000 }); } </script> <div id='a1'><img src='1.png'></div> <input type='submit' onclick="onLoadHandler(animacja1());" value='Pokaż'/>