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?
$(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.
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
Post a Comment