Je veux faire cela onmouseover changer l'image et surmouseout il renvoie l'image par défaut. J'utilise ce code:Javascript - Changer src à onmouseover et onmouseout
<div class="home-social-share">
<div style="margin-right:15px;width:11px;float:left;">
<a href="javascript:void(0)" onclick="window.open('http://www.facebook.com/sharer.php?u=<?php the_permalink();?>&t=<?php the_title(); ?>','Condividi su Facebook','height=300, width=750,scrollbars=no, resizable=yes')">
<img src="http://www.primapaginaonline.it/wp-content/themes/pponline/images/fbshareoff.png" alt="Condividi su Facebook" title="Condividi su Facebook" onmouseover="this.src='http://www.primapaginaonline.it/wp-content/themes/pponline/images/fbshare.png'" onmouseout="this.src='http://www.primapaginaonline.it/wp-content/themes/pponline/images/fbshareoff.png'">
</a>
</div>
<div style="float:left;margin-right:15px;">
<a href="javascript:void(0)" onclick="window.open('http://twitter.com/share?text=<?php the_title(); ?> • Prima Pagina Online&url=<?php the_permalink(); ?>','Condividi su Twitter','height=300, width=500,scrollbars=no, resizable=yes')">
<img src="http://www.primapaginaonline.it/wp-content/themes/pponline/images/tt-shareoff.png" alt="Condividi su Twitter" title="Condividi su Twitter" onmouseover="this.src='http://www.primapaginaonline.it/wp-content/themes/pponline/images/tt-share.png'" onmouseout="this.src='http://www.primapaginaonline.it/wp-content/themes/pponline/images/tt-shareoff.png'" />
</a>
</div>
<div style="float:left;">
<a href="<?php the_permalink();?>/#disqus_thread">
<img src="http://www.primapaginaonline.it/wp-content/themes/pponline/images/pencil-off.png" alt="Commenta l'articolo" title="Scrivi un commento sull'articolo" onmouseover="this.src='http://www.primapaginaonline.it/wp-content/themes/pponline/images/pencil.png'" onmouseout="this.src='http://www.primapaginaonline.it/wp-content/themes/pponline/images/pencil-off.png'" />
</a>
</div>
Maintenant, il fonctionne les fonctions onclick mais les images reste le même, de sorte que le onmouseover et onmouseout ne fonctionne pas.
Merci
ceci est mal écrit. Séparez Javascript de la balise, afin qu'elle soit plus lisible par l'homme. Je peux le lire, mais je pourrais voir comment vous pouvez vous perdre pour savoir pourquoi ça ne marche pas – Fallenreaper
Que voulez-vous dire par ["ne fonctionne pas"] (http://jsfiddle.net/WMHdV/1/) ?? ? – Teemu
images changeant pour moi sur 'onmouseover' et' onmouseout' – Bharadwaj