//sample solution to script.js
$(document).ready(function(){
$("#go").click(function(){
$(".block").animate({left: '+=300px'}, 3000);
});
/* Stop animation when button is clicked */
$('#stop').click(function(){
$('.block').stop();
});
/* Start animation in the opposite direction */
$("#back").click(function(){
$(".block").animate({left: '-=300px'}, 3000);
});
});
No comments:
Post a Comment