Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. function initTooltipster(){
  2. var $objects = $('[data-is-tooltipster="Y"]');
  3.  
  4. if ($objects.length>0)
  5. {
  6. $.each($objects,function(){
  7. $this = $(this);
  8.  
  9. var type = $(this).attr('data-tooltipster-type');
  10.  
  11. if (type == 'table-offset')
  12. {
  13. $this.tooltipster({
  14. onlyOne: true,
  15. theme: 'tooltipster-light',
  16. interactive: true,
  17. contentAsHTML: true,
  18. content: $this.find('.js-tooltip-content'),
  19. maxWidth: 345,
  20. functionPosition: function(instance, helper, position){
  21. position.coord.left += (position.size.width / 2) - 30; //расчет смещения
  22. return position;
  23. },
  24. });
  25. } else {
  26. $this.tooltipster({
  27. onlyOne: true,
  28. theme: 'tooltipster-light',
  29. interactive: true,
  30. contentAsHTML: true,
  31. content: $this.find('.js-tooltip-content'),
  32. maxWidth: 345,
  33. });
  34. }
  35. })
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement