Ir para conteúdo

POWERED BY:

Arquivado

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

Criisthian

O que tem de errado nesse código?

Recommended Posts

<script LANGUAGE = "JavaScript">

//  change.src = new image(64, 54); 
//  change.src = "http://img176.imageshack.us/img176/2742/buttoncontato1.gif";'>http://img176.imageshack.us/img176/2742/buttoncontato1.gif";
//  normal.src = new image(64, 54); 
//  normal.src = "http://img176.imageshack.us/img176/2742/buttoncontato1.gif";'>http://img176.imageshack.us/img176/2742/buttoncontato1.gif";

function change_image() {document.changing.src = "http://img176.imageshack.us/img176/2742/buttoncontato1.gif";'>http://img176.imageshack.us/img176/2742/buttoncontato1.gif";}
function normal_image() {document.changing.src = "http://img176.imageshack.us/img176/2742/buttoncontato1.gif";'>http://img176.imageshack.us/img176/2742/buttoncontato1.gif";}

</SCRIPT>
</HEAD>
<BODY>

<A HREF="pagina.html" onMouseOver="change_image(http://img176.imageshack.us/img176/2742/buttoncontato1.gif); 
window.status='image will change';  
return true" onMouseOut="normal_image(http://img245.imageshack.us/img245/4354/buttoncontato.gif); 
window.status='';  
return true"><IMG SRC="http://img245.imageshack.us/img245/4354/buttoncontato.gif" NAME="changing" BORDER=0></A>
</BODY>

Queria saber porqê não está funcionando o onMouseOver e o onMouseOut , alguém ajuda ? =] '

Compartilhar este post


Link para o post
Compartilhar em outros sites

Não entendi sua dúvida. =/

 

Como você definiu o changing?

 

O efeito que deseja não da para fazer com CSS? Acho que dá, hein. Com o :hover.

 

Enfim, da uma melhor explicada.

 

http://forum.imasters.com.br/public/style_emoticons/default/thumbsup.gif

Compartilhar este post


Link para o post
Compartilhar em outros sites

Teste o código abaixo em seu editor HTML e ajuste conforme suas necessidades:

 

<html>
<head>
<title>untitled document</title>

<script type="text/javascript">
function change_image() {
var objimg = document.getelementbyid("changing");
	objimg.src = "http://img176.imageshack.us/img176/2742/buttoncontato1.gif";
}

function normal_image() {
var objimg = document.getelementbyid("changing");
	objimg.src = "http://img245.imageshack.us/img245/4354/buttoncontato.gif";'>http://img245.imageshack.us/img245/4354/buttoncontato.gif";
}

</script>
</head>
<body>

<a href="pagina.html" onmouseover="change_image();window.status='image will change';return true" onmouseout="normal_image();window.status='';return true">

<img id="changing" src="http://img245.imageshack.us/img245/4354/buttoncontato.gif"  border=0></a>
</body>
</html>

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.