News

Monday, August 11, 2014

Image Animation Using JAVA SCRIPT

JavaScript is the most popular programming language in the world. This page contains some examples of what JavaScript can do in HTML. The HTML DOM (the Document Object Model) is the official W3C standard for accessing HTML elements. You can use JavaScript to: Change HTML elements Delete HTML elements Create new HTML elements Copy and clone HTML elements
Click above.....

I will show How it Works......
Here is the source code....

<!DOCTYPE html>
<html>
<body>
<script>
function changeImage() {
    var image = document.getElementById('myImage');
    if (image.src.match("2031"))
{
        image.src = "IMG_2032.jpg";
    } else
{
        image.src = "IMG_2031.jpg";
    }
}
</script>
<img id="myImage" onclick="changeImage()" src="IMG_2031.jpg" width="700" height="380">
<p>Click the Picture to see the Next one</p>

</body>
</html>

Change the bolded words with your image link and find out how it works.....

Reactions:

0 comments:

Post a Comment