Template:FloatLink: Difference between revisions

Template page
(Template:Float broken up into Template:Float and Template:FloatLink)
 
mNo edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
<plainhtml>
{{FloatLinkHelper|{{{1}}}|{{md5:{{{1}}}}}|<randomid></randomid>}}
 
<script type="text/javascript">
  var visible</plainhtml>{{{1}}}<plainhtml> = false;
 
  if(typeof useFloats == 'undefined') {
    alert('Template:UseFloats must be included for "floating frames" support.');
  }
 
  function showFloat</plainhtml>{{{1}}}<plainhtml>() {
    if(typeof useFloats == 'undefined') { return; }
 
    var float = document.getElementById('float</plainhtml>{{{1}}}<plainhtml>');
    var link = document.getElementById('floatlink</plainhtml>{{{1}}}<plainhtml>');
    var linkend = document.getElementById('floatlinkend</plainhtml>{{{1}}}<plainhtml>');
   
    float.style.display = 'block';
 
    var pos = findRelPosX(link) + ((findRelPosX(linkend) - findRelPosX(link)) / 2) - 175;
    if(pos < 0) {
      pos = 12;
    }
 
    float.style.left = pos + 'px';
 
    visible</plainhtml>{{{1}}}<plainhtml> = true;         
  }
 
  function delayedHideFloat</plainhtml>{{{1}}}<plainhtml>() {
    if(typeof useFloats == 'undefined') { return; }
 
    visible</plainhtml>{{{1}}}<plainhtml> = false;
   
    window.setTimeout("hideFloat</plainhtml>{{{1}}}<plainhtml>()", 200);
  }
 
  function hideFloat</plainhtml>{{{1}}}<plainhtml>() {
    if(typeof useFloats == 'undefined') { return; }
    if(visible</plainhtml>{{{1}}}<plainhtml>) { return; }
   
    var float = document.getElementById('float</plainhtml>{{{1}}}<plainhtml>');
     
    float.style.display = 'none';
     
    return;
  }
</script>
 
<a
  href="/wiki/</plainhtml>{{{2}}}<plainhtml>"
  title="</plainhtml>{{{2}}}<plainhtml>"
  id="floatlink</plainhtml>{{{1}}}<plainhtml>"
  onMouseOver="showFloat</plainhtml>{{{1}}}<plainhtml>()"
  onMouseOut="delayedHideFloat</plainhtml>{{{1}}}<plainhtml>()"
></plainhtml>{{{2}}}<plainhtml></a><a id="floatlinkend</plainhtml>{{{1}}}<plainhtml>"> </a>
 
</plainhtml>

Latest revision as of 10:18, 30 June 2006

<plainhtml>

<a

 href="/wiki/</plainhtml>{{{1}}}<plainhtml>"
 title="</plainhtml>{{{1}}}<plainhtml>"
 id="floatlink</plainhtml>{{md5:{{{1}}}}}<randomid></randomid><plainhtml>"
 onMouseOver="showFloat('</plainhtml>{{md5:{{{1}}}}}<plainhtml>', '</plainhtml><randomid></randomid><plainhtml>')"
 onMouseOut="delayedHideFloat('</plainhtml>{{md5:{{{1}}}}}<plainhtml>')"

></plainhtml>{{{1}}}<plainhtml></a><a id="floatlinkend</plainhtml>{{md5:{{{1}}}}}<randomid></randomid><plainhtml>"> </a>

</plainhtml>