Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function initTooltipster(){
- var $objects = $('[data-is-tooltipster="Y"]');
- if ($objects.length>0)
- {
- $.each($objects,function(){
- $this = $(this);
- var type = $(this).attr('data-tooltipster-type');
- if (type == 'table-offset')
- {
- $this.tooltipster({
- onlyOne: true,
- theme: 'tooltipster-light',
- interactive: true,
- contentAsHTML: true,
- content: $this.find('.js-tooltip-content'),
- maxWidth: 345,
- functionPosition: function(instance, helper, position){
- position.coord.left += (position.size.width / 2) - 30; //расчет смещения
- return position;
- },
- });
- } else {
- $this.tooltipster({
- onlyOne: true,
- theme: 'tooltipster-light',
- interactive: true,
- contentAsHTML: true,
- content: $this.find('.js-tooltip-content'),
- maxWidth: 345,
- });
- }
- })
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement