JQuery Tooltipster hiding element it's attached to
Asked Answered
M

1

5

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

Madelenemadelin answered 4/7, 2014 at 18:5 Comment(0)
M
8

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!

Madelenemadelin answered 4/7, 2014 at 18:53 Comment(1)
Same for me, changed the class on the image to tooltips as mentioned and also changed $('.tooltips').tooltipster(); in my document ready methodHanway

© 2022 - 2024 — McMap. All rights reserved.