How to move around an image with javascript?
问题 I'm developing a simple web quiz and using javascript, I would like to create an effect that displays a small image (1UP) that wanders around the "game deck" when users reach a specific level or score; user could gain an extra life simply clicking on it in time. Do you know any Jquery plugin or javascript snippet to achieve an effect like this? 回答1: It's actually surprisingly easy to do this: Create the element: img = document.createElement('img'); Set its source: img.src = "myimage.png";