Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Im trying to create a pop-up box type when hovering over specific text, but the text only hides and does not show further

Im trying to create a pop-up box that will pop-up when you hover over text. The text disappears but it does not reappear when you hover your mouse over it. Any improvements that can be made to the code below?

$(document).ready(function(){
  $("clo-t").hide();

  $("clo").hover(function(){
    $("clo-t").show();,
    $("clo-t").hide();
  });

})

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

You should use mouseout and mouseover instead

$(document).ready(function() {
  $(".clo").mouseover(() => {
    $(".clo-t").show();
  }).mouseout(t => {
    if (!$(t.target).hasClass("clo-t"))
      $(".clo-t").hide();
  })
})
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading