New file |
0,0 → 1,113 |
/*vim: set expandtab tabstop=4 shiftwidth=4: */ |
// +------------------------------------------------------------------------------------------------------+ |
// | Javascript version 1.5 | |
// +------------------------------------------------------------------------------------------------------+ |
// | Copyright (C) Tela Botanica (accueil@tela-botanica.org), 2005. | |
// +------------------------------------------------------------------------------------------------------+ |
// | This file is part of Chorologie. | |
// | | |
// | Foobar is free software; you can redistribute it and/or modify | |
// | it under the terms of the GNU General Public License as published by | |
// | the Free Software Foundation; either version 2 of the License, or | |
// | (at your option) any later version. | |
// | | |
// | Foobar is distributed in the hope that it will be useful, | |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
// | GNU General Public License for more details. | |
// | | |
// | You should have received a copy of the GNU General Public License | |
// | along with Foobar; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: echoro.js,v 1.1 2005-05-19 07:37:47 jpm Exp $ |
/** |
* Contient le code javascript. |
* |
* |
*@package eFlore |
*@subpackage Chorologie |
//Auteur original : |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org> |
//Autres auteurs : |
*@author Aucun |
*@copyright Tela-Botanica 2000-2005 |
*@version $Revision: 1.1 $ $Date: 2005-05-19 07:37:47 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
|
//D'autres scripts sur http://www.toutjavascript.com |
//Si vous utilisez ce script, merci de m'avertir ! < webmaster@toutjavascript.com > |
//Auteur original :Olivier Hondermarck <webmaster@toutjavascript.com> |
//Modifs compatibilité Netscape 6/Mozilla : Cédric Lamalle 09/2001 <cedric@cpac.embrapa.br> |
//Correction Mac IE5 (Merci Fred) |
var IB=new Object; |
var posX=0; |
var posY=0; |
var xOffset=10; |
var yOffset=10; |
|
function AffBulle(texte) |
{ |
contenu='<table border="0" cellspacing="0" cellpadding="'+IB.NbPixel+'"><tr bgcolor="'+IB.ColContour+'"><td><table border="0" cellpadding="2" cellspacing="0" bgcolor="'+IB.ColFond+'"><tr><td style="color:'+IB.ColTexte+';">'+texte+'</td></tr></table></td></tr></table> '; |
|
var finalPosX=posX-xOffset; |
|
if (finalPosX<0) { |
finalPosX=0; |
} |
|
if (document.getElementById) { |
document.getElementById('bulle').innerHTML=contenu; |
document.getElementById('bulle').style.top=posY+yOffset+'px'; |
document.getElementById('bulle').style.left=finalPosX+'px'; |
document.getElementById('bulle').style.zIndex=100; |
document.getElementById('bulle').style.visibility="visible"; |
//Nous vérifions que nous utilisons bien IE ou Mozilla pour supprimer les valeurs tiltes de images fournissant les infos bulles d'aides. |
//Cela pourrait être amélioré en vérifiant aussi les liens car l'aide pourrait être donnée par l'intermédiaire de lien. |
//alert(navigator.appName); |
if (document.images.length) { |
//if (navigator.appName == 'Netscape' || navigator.appName == 'Microsoft Internet Explorer') { |
for(i=1; i<document.images.length; i++) { |
var nom = 'echoro_info_0'+i; |
if (document.images[nom] != null ) { |
document.images[nom].title = ""; |
} |
} |
} |
} |
} |
|
function getMousePos(e) |
{ |
if (document.getElementById) { |
posX=e.pageX; |
posY=e.pageY; |
} |
} |
|
function HideBulle() |
{ |
if (document.getElementById) { |
document.getElementById('bulle').style.visibility = 'hidden'; |
} |
} |
|
function InitBulle(ColTexte,ColFond,ColContour,NbPixel) |
{ |
IB.ColTexte=ColTexte;IB.ColFond=ColFond;IB.ColContour=ColContour;IB.NbPixel=NbPixel; |
if (document.getElementById) { |
document.onmousemove = getMousePos; |
document.write('<div id="bulle" style="position:absolute;top:0;left:0;visibility:hidden;"></div>'); |
} |
} |
|
//// InitBulle(couleur de texte, couleur de fond, couleur de contour, taille contour); |
InitBulle("navy","#FFCC66","orange", 1); |
|
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* |
* +-- Fin du code ----------------------------------------------------------------------------------------+ |
*/ |