0

I am using $(el).tootltips(); and it is working fine but it doesn't effect on future objects. How can I initialized this effect for future objects too.

Cœur
  • 34,719
  • 24
  • 185
  • 251
Shakeel Ahmed
  • 1,318
  • 15
  • 21

1 Answers1

0

You can do this in two ways:

  1. focus on the element and initialize it.
  2. wrap it in a function and call it when you add your future objects.

1.

$('body').on('focus', '.classNameOfFutureObj', function(){
    $(this).tootltips();
});

2.

function makeTooltip($el){
  $el.tootltips();
}
// you can call this function when you append your object in dom.
makeTooltip($('.classNameOfFutureObj'))
Jai
  • 72,925
  • 12
  • 73
  • 99