Animation Using JavaScript
Introduction
Before explaining the article, I would like to thank all readers who read myarticle and voted for it. Your appreciation for my article gives me strength towrite more good articles. Hope in future I will get your valuable comments andsuggestions. Now I won't waste your time and come back to the topic. I havewritten this article on ‘JavaScriptAnimation’. In this article, it is possible to use JavaScript to createanimated images. The trick is to let a JavaScript change between differentimages on different events.
In the following example we will add an image that should act as a linkbutton on a web page. We will then add an onMouseOver event and an onMouseOutevent that will run two JavaScript functions that will change between theimages.
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
ValidationPage
functionmouseOver()
{
document.getElementById("b1").src ="Bluehills.jpg";
}
function mouseOut()
{
document.getElementById("b1").src ="Sunset.jpg";
}
script>
head>
<body>
<img border="0" alt="Visit DotNetLogic!" src="Bluehills.jpg"id="b1"width="26"height="26"onmouseover="mouseOver()"onmouseout="mouseOut()"/>
body>
html>