Wednesday, 25 October 2017

create animation using js











html code:



<!doctype html>

<html>

<head>

<meta charset="utf-8">

<title>space</title>

<style>

body

{ margin:0 auto;

padding:0px;

}



#wrapper

{

height:900px;

background-image:url(img/maxresdefault.jpg);

background-size:100% 900px;

 

}



</style>



</head>



<body>



<div id="wrapper">



<img src="img/1.png"  style="margin-left:300px; margin-top:150px;" id="st" onMouseOver="runcomplete()"/>





 </div>















<script src="js/js.js"> </script>





</body>

</html>



javascript code:
// JavaScript Document
A=new Array("img/2.png","img/3.png","img/1.png");

function a()
{ document.getElementById('st').src=A[0];
}
function b()
{ document.getElementById('st').src=A[1];
}
function c()
document.getElementById('st').src=A[2];
}

function runcomplete()
{
setTimeout(a,500);
setTimeout(b,1000);
setTimeout(c,1500);
setTimeout(a,2000);
setTimeout(b,2500);
setTimeout(c,3000);

}









No comments:

Post a Comment

Pass Dynamically Added Html Table Records List To Controller In Asp.net MVC

Controller Code: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using ...