Question: Task 1: Create a web page using jQuery with a kitten image and two buttons on it. The first button causes the kitten to move
Task 1: Create a web page using jQuery with a kitten image and two buttons on it. The first button causes the kitten to move from left to right and vice versa continuously on the screen. The second button causes the kitten to stop. When you click on the first button again after the kitten is stopped, the kitten will move in the same direction as before. [note: if the kitten originally moved from left to right and it stopped, then it should move from left to right again after it resumes movement]
------------------------------------------------------------------------
this is what i have so far. but the stop function does not work.
$(document).ready(function () {
$('#start').click(function () {
$('img').animate(
{
left: '500px'
},
5000
);
$('#stop').click(function () {
$('#divv').stop();
});
});
});
img {
position: relative;
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
