[ Index ]
 

Code source de Dolibarr 2.0.1

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/htdocs/lib/ -> lib_foot.js (source)

   1  // Copyright (C) 2005 Laurent Destailleur  <eldy@users.sourceforge.net>
   2  //

   3  // Script javascript mis en bas de page (avant fin de body)

   4  //

   5  // \file       htdocs/lib/lib_foot.js
   6  // \brief      Fichier qui inclue les fonctions javascript de fin de page si option use_javascript active
   7  // \version    $Revision: 1.1 $
   8  
   9  
  10  
  11  /***********************************************

  12  * Cool DHTML tooltip script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)

  13  * This notice MUST stay intact for legal use

  14  * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code

  15  ***********************************************/
  16  
  17  var offsetxpoint=-60 //Customize x offset of tooltip
  18  var offsetypoint=20 //Customize y offset of tooltip
  19  var ie=document.all
  20  var ns6=document.getElementById && !document.all
  21  var enabletip=false
  22  if (ie||ns6)
  23  var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""
  24  
  25  function ietruebody(){
  26  return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
  27  }
  28  
  29  function ddrivetip(thetext, thecolor, thewidth){
  30  if (ns6||ie){
  31  if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
  32  if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
  33  tipobj.innerHTML=thetext
  34  enabletip=true
  35  return false
  36  }
  37  }
  38  
  39  function positiontip(e){
  40  if (enabletip){
  41  var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
  42  var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
  43  //Find out how close the mouse is to the corner of the window

  44  var rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20
  45  var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20
  46  
  47  var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000
  48  
  49  //if the horizontal distance isn't enough to accomodate the width of the context menu

  50  if (rightedge<tipobj.offsetWidth)
  51  //move the horizontal position of the menu to the left by it's width

  52  tipobj.style.left=ie? ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+"px" : window.pageXOffset+e.clientX-tipobj.offsetWidth+"px"
  53  else if (curX<leftedge)
  54  tipobj.style.left="5px"
  55  else
  56  //position the horizontal position of the menu where the mouse is positioned

  57  tipobj.style.left=curX+offsetxpoint+"px"
  58  
  59  //same concept with the vertical position

  60  if (bottomedge<tipobj.offsetHeight)
  61  tipobj.style.top=ie? ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint+"px" : window.pageYOffset+e.clientY-tipobj.offsetHeight-offsetypoint+"px"
  62  else
  63  tipobj.style.top=curY+offsetypoint+"px"
  64  tipobj.style.visibility="visible"
  65  }
  66  }
  67  
  68  function hideddrivetip(){
  69  if (ns6||ie){
  70  enabletip=false
  71  tipobj.style.visibility="hidden"
  72  tipobj.style.left="-1000px"
  73  tipobj.style.backgroundColor=''
  74  tipobj.style.width=''
  75  }
  76  }
  77  
  78  document.onmousemove=positiontip;
  79  


Généré le : Mon Nov 26 12:29:37 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics