INNER CODE UNIT · JavaScript

show

ucscGenomeBrowser/kent · src/hg/utils/registryPages/index.js:39

  function show(el){
    var h = html_for(el); if (!h) return;
    tip.innerHTML = h;
    tip.setAttribute('data-on','1');
    tip.setAttribute('aria-hidden','false');
    cur = el;
    place(el);
  }
  function place(el){
    var r = el.getBoundingClientRect();
    var t = tip.getBoundingClientRect();
    var x = r.left;
    if (x + t.width > window.innerWidth - 12) x = window.innerWidth - 12 - t.width;
    if (x < 12) x = 12;
    var y = r.bottom + 8;
    if (y + t.height > window.innerHeight - 12) y = r.top - t.height - 8;
    if (y < 12) y = 12;
    tip.style.left = Math.round(x) + 'px';

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…