Toggle show/hide a div by hovering another item


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <script type="text/javascript">
  2. $(document).ready(function() {
  3. var hide = false;
  4. jQuery("img.shadow").hover(function(){
  5. if (hide) clearTimeout(hide);
  6. jQuery(".post_share").fadeIn();
  7. }, function() {
  8. hide = setTimeout(function() {jQuery(".post_share").fadeOut("slow");}, 250);
  9. });
  10. jQuery(".post_share").hover(function(){
  11. if (hide) clearTimeout(hide);
  12. }, function() {
  13. hide = setTimeout(function() {jQuery("post_share").fadeOut("slow");}, 250);
  14. });
  15. });
  16. </script>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.