Sayfada yüzen balina
A ve D harflerinden sağa sola hareket ettirebilirsniz
A ve D harflerinden sağa sola hareket ettirebilirsniz
Kod:
<!--- kerimdj.tr.gg- Kod Başlangıcı --->
<FONT color=#115585 size=3><strong><em>A</em></strong> tuşu ile sola, <strong><em>D</em></strong> tuşu ile sağa kaydırabilirsiniz...</FONT>
<div id="blockDiv" STYLE="position:absolute; left:317px; top:130px; width:137px; height: 121px">
<img src="http://www.sayfam.net/webmaster/gif/jaws.gif"></div>
<STYLE>.spanstyle {
POSITION: absolute; VISIBILITY: hidden
}
</STYLE>
<SCRIPT LANGUAGE="JavaScript">
n = (document.layers) ? 1 : 0;
ie = (document.all) ? 1 : 0;
function moveImage() {
if (n) {
block = document.blockDiv;
}
if (ie) {
block = blockDiv.style;
}
block.xpos = parseInt(block.left);
block.active = 0;
document.onkeydown = keyDown;
document.onkeyup = keyUp;
if (n) {
document.captureEvents(Event.keydown | Event.keyup);
}
}
function keyDown(e) {
if (n) {
var nKey = e.which;
var ieKey = 0;
}
if (ie) {
var ieKey = event.keyCode;
var nKey = 0;
}
if ((nKey == 97 || ieKey == 65) && !block.active) {
block.active = 1;
slideLeft();
}
if ((nKey == 100 || ieKey == 68) && !block.active) {
block.active = 1;
slideRight();
}
}
function keyUp(e) {
if (n) {
var nKey = e.which;
var ieKey = 0;
}
if (ie) {
var ieKey = event.keyCode;
var nKey = 0;
}
if ((nKey == 97 || ieKey == 65 || nKey == 100 || ieKey == 68))
block.active = 0;
}
function slideRight() {
if (block.active) {
block.xpos += 5;
block.left = block.xpos;
status = block.xpos;
setTimeout("slideRight()", 25);
}
}
function slideLeft() {
if (block.active) {
block.xpos -= 5;
block.left = block.xpos;
status = block.xpos;
setTimeout("slideLeft()", 25);
}
}
</script>
</HEAD>
<BODY OnLoad="moveImage()">
<!--- kerimdj.tr.gg - Kod Sonu --->