Search code examples
javascriptjqueryjquery-uitooltip

jQuery UI tooltips appearing when hovering over third-party ads


Problem

I'm having an issue with tooltips with jQuery UI involving third-party ads. When I hover over the ad, I see a tooltip with the text "3rd party content". I only want the tooltips to appear on elements that have a class of .fa-question-circle

  • I can see that the ad is being loaded through an iframe and it contains title=3rd party ad content. I just want to be able to prevent that from being seen by the user.

scripts.js

  // Tooltips
  $(".fa-question-circle").tooltip({
    tooltipClass: "popup",
    position: {
      my: "center bottom-15",
      at: "center top"
    },
    hide: false
  });

Solution

  • In the end, it looked like this:

      // Tooltips
      $(document).tooltip({
        tooltipClass: "popup",
        items: ".fa-question-circle",
        position: {
          my: "center bottom-15",
          at: "center top",
          collision: 'none'
        },
        hide: false
      });