Transmettre une variable dans une fonction
Bonjour,
voici mon code.
Comment passer la variable "originalsrc" dans la deuxième fonction ?
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
| $(function ()
{
$("#bouton_exploit img").hover(function(){
var idname = $(this).attr('id');
var originalsrc = this.getAttribute('src');
$("#" + idname).attr('src', mesimagesover[idname]);
}),
$("#bouton_exploit img").mouseout(function(originalsrc){
alert(originalsrc);
var idname = $(this).attr('id');
$("#" + idname).attr('src', originalsrc);
});
}); |
Merci