Basically i am trying to have a button which allows the user to hover for which an other image will be displayed on top, but when the clicks on it will be set to a click image state
I have tried to use jquery hover function but i have had no luck - it does not allow me to click on the button and display the overstate
i can get it too work individually for example if a user clicks on a button then a new image will appear, but when i try and get hover to work aswell as a clicked overstate it messes up
any help would be appreciated
Jquery
$('.M').hover(
function(){
$(this).attr('src','Buttons/Button-MaleOver.png')
},
function(){
$(this).attr('src','Buttons/Button-Male.png')
}
)
$(".M").click(function(){
$(this).prop("src","Buttons/Button-MaleOver.png");
});
HTML
<img class="M" src="Buttons/Button-Male.png" ></img>