|
Bangladeshi Softwares
|
| Home - Download - Codes & Tutorials - Bangla IT Bibhag - Mobile - About Me |
Moving an object in Internet Explorer
Step-1:
You can move an object using some simple techniques in Internet Explorer. Open your favorite text editor and type the code below:
<head>
<script language="javascript" type="text/javascript">
<!--
/*
* Author: Ahsanul Haque Shovon
* Email: ahsanul.haque.shovon@gmail.com / ahsanul_haque_shovon@yahoo.com
* Web: http://shovon.110mb.com
*/
cnt = 0;
/********************************************
* This function will move the object either
* to the left or down to the bottom.
********************************************
function runBaby()
{
var rnd = Math.floor(Math.random() * 2) + 1;
if(rnd == 1)
{
document.all.aha.style.pixelTop += 100;
}
else
{
document.all.aha.style.pixelLeft += 100;
}
}
/*******************************************
* Well this function will generate a dialog
* box offering you to reload this script
* again.
*******************************************/
function result()
{
if(cnt == 1)
{
if(window.confirm("You win! Do you wish to test yourself again?"))
{
document.location.reload();
}
}
else
{
if(window.confirm("You lose! Do you wish to test yourself again?"))
{
document.location.reload();
}
}
}
var timer = setTimeout("result()", 120000);
//-->
</script>
<style type="text/css">
<!--
.divStyle
{
position: relative;
top: 0px;
left: 0px;
}
-->
</style>
</head>
<body>
<div id="aha" class="divStyle">
<form>
<input type="button" value="Catch me if you can!" name="clkme"
onmouseover="runBaby();" onclick="cnt++;">
</form>
</div>
</body>
|
©Ahsanul Haque Shovon
All rights reserved
|