jquery - When the animation has run once I can still see the text in a very light opacity, could someone please help remove this? -


when animation has run once can still see text in light opacity, please remove this?

here jsfiddle

$(document).ready(function () {  $('.btn').click(function () {      $('.tooltip').animate({          opacity: 0,      }, 0);      $('.tooltip').animate({          bottom: '40px',          width: '163px',          opacity: 1      }, 400);      $('.tooltip').css({          'display': 'block',      }).delay(1400);      $('.tooltip').animate({          opacity: 0,          bottom: '30px'      }, 200);  }); }); 

while did observe problem, have agree billy moat in it's optical illusion. there way can improve upon tooltip. after first time stay visible transparent. allows use select text (notice mouse cursor change when hovering).

you can fix using display:none or visibility:hidden hide after animation completed.

jsfiddle

js

 $(document).ready(function () {      $('.btn').click(function () {          $('.tooltip')              .addclass('show')              .animate({                  opacity: 0,              }, 0)              .animate({                  bottom: '40px',                  width: '163px',                  opacity: 1              }, 400)              .delay(1400);          $('.tooltip')              .animate({                  opacity: 0,                  bottom: '30px'              }, 200);          settimeout(function () {              $('.tooltip').removeclass('show');          }, 2000);      });  }); 

css

.tooltip {     visibility:hidden;     width: 164px;     left: 6px;     display: block;     height: 33px;     position: absolute;     bottom: 20px;     background-image: url('http://www.rusterholz.dk/btn.png');     background-repeat: no-repeat;     background-position: top left; } .tooltip.show {     visibility:visible; } 

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -