|
|
|
|
BULLES D'AIDE DYNAMIQUES
DU
SEXE !
Informe tes visiteurs sur ce qui se cache derrière un lien VRAIMENT DU SEXE ?
Recopie le script suivant dans la partie HEAD de ton document :
<SCRIPT LANGUAGE="Javascript">
<!-- Scripts des bulles d'aide
// Tu peux utiliser ou modifier ce script librement
IE4 = (document.all) ? 1 : 0;
NS4 = (document.layers) ? 1 : 0;
VERSION4 = (IE4 | NS4) ? 1 : 0;
if (!VERSION4) event = null;
function helpGetOffset(obj, coord) {
var val = obj["offset"+coord] ;
if (coord == "Top") val += obj.offsetHeight;
while ((obj = obj.offsetParent )!=null) {
val += obj["offset"+coord];
if (obj.border && obj.border != 0) val++;
}
return val;
}
function helpDown () {
if (IE4) document.all.helpBox.style.visibility = "hidden";
if (NS4) document.helpBox.visibility = "hidden";
}
function helpOver (event,texte) {
if (!VERSION4) return;
var ptrObj, ptrLayer;
if (IE4) {
ptrObj = event.srcElement;
ptrLayer = document.all.helpBox;
}
if (NS4) {
ptrObj = event.target;
ptrLayer = document.helpBox;
}
if (!ptrObj.onmouseout) ptrObj.onmouseout = helpDown;
var str = '<DIV CLASS="helpBoxDIV">'+texte+'</DIV>';
if (IE4) {
ptrLayer.innerHTML = str;
ptrLayer.style.top = helpGetOffset (ptrObj,"Top") + 2;
ptrLayer.style.left = helpGetOffset (ptrObj,"Left");
ptrLayer.style.visibility = "visible";
}
if (NS4) {
ptrLayer.document.write (str);
ptrLayer.document.close ();
ptrLayer.document.bgColor = "yellow";
ptrLayer.top = ptrObj.y + 20;
ptrLayer.left = ptrObj.x;
ptrLayer.visibility = "show";
}
}
// -->
</SCRIPT>
<STYLE TYPE='text/css'>
<!--
#helpBox {
position: absolute;
z-index: 1000;
top: 0px;
left: 0px;
width: 160px;
}
DIV.helpBoxDIV {
width: 160px;
padding: 2px;
background: yellow;
border: 1px solid black;
color: black;
font-family: Arial,Helvetica;
font-style: Normal;
font-weight: Normal;
font-size: 12px;
line-height: 14px;
}
-->
</STYLE>
Ensuite recopie le code HTML suivant dans la partie BODY de ton document :
<!-- Affichage des bulles d'aide -->
<DIV ID="helpBox"></DIV>
Ajoute à tes liens qui doivent afficher une bulle d'aide, la fonction onMouseover :
<A HREF="..." onMouseover="helpOver(event,'ton texte d\'aide')">Attention, si tu utilises le caractère ' dans le texte d'aide, tu devras ajouter le caractère \ devant.
ED
05-03-2003