Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Hugo Borges_120734

como alterar este codigo

Recommended Posts

Galere estou com um código em java onde a imagem fica andando na tela, queria mudar ele para que ela andasse de esquerda para direita e depois sumisse.

 

E alguma coisa nesse código atrapalha a acentuação. Preciso de ajuda.

 

segue o código:

ççççç<div id="img" style="position:absolute;"><img src="http://t3.gstatic.com/images?q=tbn:ANd9GcSh1cD45e0kVtWzgik1b_bHh0QlcfhSaOfAXe1sBd1kfj1nzAPr" onMouseDown="pauseResume();" width="202" height="92"></div><SCRIPT LANGUAGE="JavaScript"><!-- By Mr. Addono --><!-- Beginvar step = 5;var delay = 30;var height = 0;var Hoffset = 0;var Woffset = 0;var yon = 0;var xon = 0;var pause = true;var interval;var name = navigator.appName;if(name == "Microsoft Internet Explorer") name = true;else name = false;var xPos = 20;if(name) var yPos = document.body.clientHeight;else var yPos = window.innerHeight;function changePos() {if(name) {width = document.body.clientWidth;height = document.body.clientHeight;Hoffset = img.offsetHeight;Woffset = img.offsetWidth;img.style.left = xPos + document.body.scrollLeft;img.style.top = 0;}else {height = window.innerHeight;width = window.innerWidth;Hoffset = document.img.clip.height;Woffset = document.img.clip.width;document.img.pageY = yPos + window.pageYOffset;document.img.pageX = xPos + window.pageXOffset;}if (yon) {yPos = yPos + step;}else {yPos = yPos - step;}if (yPos < 0) {yon = 1;yPos = 0;}if (yPos >= (height - Hoffset)) {yon = 0;yPos = (height - Hoffset);}if (xon) {xPos = xPos + step;}else {xPos = xPos - step;}if (xPos < 0) {xon = 1;xPos = 0;}if (xPos >= (width - Woffset)) {xon = 0;xPos = (width - Woffset);   }}function start() {if(name) img.visibility = "visible";else document.img.visibility = "visible";interval = setInterval('changePos()',delay);}function pauseResume() {if(pause) {clearInterval(interval);pause = false;}else {interval = setInterval('changePos()',delay);pause = true;   }}start();//  End --></script>

Des de ja agradeço.

 

 

galera alguém sabe?

Compartilhar este post


Link para o post
Compartilhar em outros sites

Desculpe, pensei ter lido "código em java"... enfim.

 

Você precisa verificar quando o [inline]xPos[/inline] for maior que o valor que você quer de máximo à direita e, quando for, ocultar a imagem.

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.