I am working on a project that requires me to create a javascript file for a webpage with 4 images and 4 check boxes. Each check box is linked to an image. When a check box is clicked, the image linked to it is supposed to do something. Image 1 is supposed to spin, image 2 is supposed to shrink and grow, image 3 will move up and down, and image 4 should skew left and right. All of these actions are supposed to continue until the check box is un-clicked.
I think for me the hardest part is that we aren't allowed to edit the HTML or the CSS, we can only work with the Javacript file. I'm having trouble figuring out how to link the actions of the pictures to the check boxes (like making image 1 spin when the first check box is clicked). Right now, I'm primarily focused on the spinning image since I think if I can figure out how that one works, I should be able to figure out how to make the other 3 work as well. Can anyone point me in the right direction on how to make an image perform a particular action when a check box is clicked?
Here is what I have in my Javascript file so far:
<script type = "text/javascript">
function spinPic() {
rotateAnimation("one",20);
}
</script>
Here is a jsfiddle I've made with the HTML, CSS, and what little is in my JS file. http://jsfiddle.net/k7bt0u17/
http://www.developphp.com/view.php?tid=1307 let me know if this solves your problem – rahul_send89 Sep 22 '14 at 06:14