6

I am trying to use JQuery Tooltipster in my Asp.net MVC application.

The content I am trying t add the tooltip to is generated dynamically through JavaScript.

View:

    var engName = document.getElementsByClassName("dhx_matrix_scell");
    for (var i = 0; i < engName.length; i++) {
        engName[i].className = engName[i].className + " tooltip";
        engName[i].title = "Hello";
    }

top of my index:

    $(document).ready(function () {
    $('.tooltip').tooltipster(
    {
         multiple: true
    });
});

The tooltip does work, but it doesn't appear in the right spot, and it doesnt display the element that uses the tooltip class.

Pic for reference: enter image description here

Stephen Sugumar
  • 545
  • 3
  • 9
  • 35

1 Answers1

9

so I figured out my problem! I was also using a Bootstrap.css link in my project as well, and there was a mismatch between the class names "tooltip"

I changed the name to "tooltips" and it initialized it as such, and it worked flawlessly!

Stephen Sugumar
  • 545
  • 3
  • 9
  • 35
  • 2
    Same for me, changed the class on the image to tooltips as mentioned and also changed $('.tooltips').tooltipster(); in my document ready method – JsonStatham Jul 06 '15 at 14:47