D
D
Dmitry Petrik2015-03-27 09:54:49
JavaScript
Dmitry Petrik, 2015-03-27 09:54:49

Ajax, Tooltip and Modal. How is it all to make friends with each other?

Such a problem. By clicking on the "chat" button in the modal window, a chat opens, where old messages are loaded via ajax. I want to shorten the date and time of the message and make it the same as VKontakte, i.e. part of the date is shown, the rest is through the tooltip. The problem is that tooltip doesn't want to work with messages loaded via ajax. Tell me how you can solve the problem?

After loading messages, I tried to call the function , but it doesn't work like that. The z-index for the tooltip also did more than the modal window, but that doesn't matter, because. the tooltip just doesn't work.
$('.datetime').tooltip();
446556b2fdd54400aabd21a672671f5c.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Talalaev, 2015-03-27
@Flexo

Hmm.. I don't know, like a tooltip with dynamic elements works fine jsfiddle.net/7qwjhvLw

$(function () {
     $(".warp").append('<a class="showtooltip" title="Покажи меня">Что что?</a>');
     $( document ).tooltip();
     $('.showtooltip').tooltip();
 });

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question