Widget:Tooltip: Difference between revisions

From Unforgotten Realms Wiki
Jump to navigationJump to search
imported>Pillowkeeper
Created page with "<span class="marker"> {{{text}}} <span class="tooltip"> {{{tooltip}}} </span> </span> <script> var tooltipSpan = document.getElementsByClassName('tooltip'); window.onmousemo..."
 
imported>Pillowkeeper
No edit summary
Line 1: Line 1:
<span class="marker">
<span class="marker">
{{{text}}}
<!--{$text|escape:'html'}-->
<span class="tooltip">
<span class="tooltip">
{{{tooltip}}}
<!--{$tooltip|escape:'html'}-->
</span>
</span>
</span>
</span>

Revision as of 14:06, 9 August 2017

<script> var tooltipSpan = document.getElementsByClassName('tooltip');

window.onmousemove = function (e) {

   var x = e.clientX,
       y = e.clientY;
   for (var i = 0; i < tooltipSpan.length; i++) {
   tooltipSpan[i].style.top = (y + 15) + 'px';
   tooltipSpan[i].style.left = (x + 15) + 'px';
   }

}; </script>