Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Power BI user groups Hero banner

Fabric User Groups

Explore creative solutions by learning new skills and sharing ideas with like-minded peers and product experts.

Find events Find groups

Explore other User Groups

Azure Data User Groups

Find User Groups and resources related to SQL Server and Azure Data.

Azure Data User Groups

Power Platform User Groups

Come find like-minded peers of all experience levels and skillsets to learn, grow and engage.

Power Platform User Groups
'); } holder = $('body').find('.ztip-holder'); }; this.build = function () { plugin.on('mouseover', function () { var elem = $(this), tip = plugin.getElemTip(elem); if (!tip) { return; } plugin.refreshHolderTheme(); holder.children('.zt-text').html(tip); var coords = plugin.getElementCoordinates(elem); if (holder.outerWidth() ')) { return elem.children(settings.source.replace('>', '')).html(); } // Its a DOM element? Probably... else { return $(settings.source).html(); } }; this.autoPosition = function (coords) { var _top = '', _left = '', viewport = plugin.getViewport(); // It's not wider than current window? if (holder.outerWidth() > viewport.width) { holder.css({ 'max-width': viewport.width, }); } if ('bottom' === settings.position) { if (holder.outerHeight() + 10 > coords.fromBottom) { _top = coords.top - holder.outerHeight() - 10; plugin.changeHolderPosition('top'); } else { _top = coords.bottom + 10; plugin.changeHolderPosition('bottom'); } } else { if (holder.outerHeight() + 10 coords.centerX) { _left = 0; if (is_small && maybe_left holder.outerWidth()) { _left = coords.left; } } else if (half_holder holder.outerWidth()) { _left = coords.right - holder.outerWidth(); } } else { _left = coords.centerX - holder.outerWidth() / 2; } // Align the tooltip in space plugin.holderCss({ 'top': (_top !== '' ? _top + 'px' : ''), 'left': (_left !== '' ? _left + 'px' : ''), }); var rec = holder[0].getBoundingClientRect(), arr_left = coords.centerX - rec.left, arr = holder.children('.zt-arrow'); // Align the arrow arr.css({ 'left': arr_left, 'margin-left': -arr.outerWidth() / 2, }); }; this.holderCss = function (holder_css) { var new_holder_css = { 'top': holder_css.top || '', 'right': holder_css.right || '', 'bottom': holder_css.bottom || '', 'left': holder_css.left || '', }; holder.css(new_holder_css); }; /** * Get element coordinates. * * @param {object} elem The jQuery element object to get coordinates for. * @return {object} Element coordinates. */ this.getElementCoordinates = function (elem) { // pure JS selected element var element = elem; // jQuery selected element if (elem instanceof jQuery) { element = elem[0]; } // Get top/left rectangular positions. var rec = element.getBoundingClientRect(); // Get element dimensions var width = rec.right - rec.left, height = rec.bottom - rec.top; // Return the coordinates of this element in current viewport return { width: width, height: height, top: rec.top, left: rec.left, bottom: rec.bottom, right: rec.right, fromTop: rec.top, fromLeft: rec.left, fromBottom: $(window).innerHeight() - rec.bottom, fromRight: $(window).innerWidth() - rec.right, centerX: rec.left + width / 2, centerY: rec.top + height / 2, }; }; /** * Get viewport dimensions * * @return {object} */ this.getViewport = function () { return { width: $(window).innerWidth(), height: $(window).innerHeight(), }; }; this.changeHolderPosition = function (position) { plugin.replaceClass(/\bztip-position-\S+/g, 'ztip-position-' + position); }; this.refreshHolderTheme = function () { plugin.replaceClass(/\bztip-theme-\S+/g, 'ztip-theme-' + settings.theme); }; this.replaceClass = function (_to_replace, _with) { if (!holder.hasClass(_with)) { holder.removeClass( function (index, css) { return (css.match(_to_replace) || []).join(' '); } ).addClass(_with); } }; this.stringStartsWith = function (the_string, search_string, position) { return the_string.substr(position || 0, search_string.length) === search_string; }; init(); return this; }; })(jQuery);