Enter Keyword Hear for Search This Blog

Showing posts with label How to create window clock using move in JavaScript. Show all posts
Showing posts with label How to create window clock using move in JavaScript. Show all posts

Friday, 4 March 2016

How to create window clock using move in JavaScript

clock.html


<html>
<head><title> MoveBy</title>
</head>
<script>
var x=0;
var y=0;
function openwin()
{
mywin=window.open("","","width=10,height=10");
}
function closewin()
{
if(mywin)
{
mywin.close();
}
}

function movebywin()
{
if(x<600 && y==0)
{
x=x+200;
if(x==600)
{
y=y+100;
}
}
else if(x==600 && y<=300)
{
y=y+100;
if(y==300)
{
x=x-200;
}
}
else if( x<=600 && y==300)
{
x=x-200;
if(x==0)
{
y=y-100;
}
}
else if(x==0 && y<=300)
{
y=y-100;
if(y==0)
{
x=x+200;
}
}
mywin.moveTo(x,y);
mywin.focus();
}
</script>
<body>
<input type="button" value="Open window" onclick="openwin()">
<input type="button" value="Move" onclick="movebywin()">
<input type="button" value="Close" onclick="closewin()">
</body>
</html>

Featured post

what is ajax?how to create ajax with php code

Ajax Introduction -  એજેક્સ નો ઉપીયોગ કરી ને તમે પેજ લોડ કાર્ય વિના બધી માહિતી મેળવી શકો.એજેક્સ થી તમે કોઈ પણ ડેટા ઝડપ થી મેળવી શકો છો...