removeclass - Fade out and remove a <div> -
how can fade out following? need removed completely, not alpha 0 display:none , visibility:hidden after fade out.
fiddle: http://jsfiddle.net/fourroses666/ywmux/2/
js:
<script type="text/javascript" language="javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script> <script type="text/javascript"> $('.go-away').click(function() { $('.message').removeclass('show'); }); </script> css:
<style> .message{display:none; visibility:hidden;} .message.show{display:block; visibility:visible;} .go-away{float:right; cursor:pointer; cursor:hand;} </style> html:
<div class="message show">pizza nice! <div class="go-away">x</div></div>
try this
$('.go-away').click(function() { $(this).parent().fadeout(); });
Comments
Post a Comment