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
  • 37,241
  • 25
  • 195
  • 267
Shakeel Ahmed
  • 1,526
  • 17
  • 22

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
  • 74,255
  • 12
  • 74
  • 103