[Solved] How do I write a hover code? [closed]


why not use CSS (3 if you want animation)?

#login{
  position: absolute;
  top: 42px;
  left: 1202px;
  width: 63px;
  height: 19px;
  background-color: #2799b6;
  text-align: center;
  font-family: corbel;
  border-radius:20px;
  color:#FFF;
  font-size:15px;
  opacity:1;
  -moz-transition:    opacity .5s;
  -o-transition:      opacity .5s;
  -webkit-transition: opacity .5s;
  transition:         opacity .5s;
}
#login:hover{
  opacity:0;
  -moz-transition:    opacity .5s;
  -o-transition:      opacity .5s;
  -webkit-transition: opacity .5s;
  transition:         opacity .5s;
}

I have no idea why you would want a button/element to disappear on mouse over but hey!

if you just want an answer to your original question:

$(document).ready(function() {

    $('#login').hover(function(){$(this).fadeOut()},function(){$(this).fadeIn()});

});

problem being, fadeOut makes the item properly hidden, therefore it will automatically reappear as you mouse out when it vanishes…..

1

solved How do I write a hover code? [closed]