Dyx50
Messages postés10Date d'inscriptionvendredi 19 août 2005StatutMembreDernière intervention23 mars 2008
-
23 mars 2008 à 13:17
cs_bultez
Messages postés13615Date d'inscriptionjeudi 13 février 2003StatutMembreDernière intervention15 octobre 2013
-
24 mars 2008 à 09:17
Bonjour,
Alors voila depuis 2 jours je me casse la tête à propos de ma question. J'explique mon problème :
J'ai un espace membre ou le membre peut ajouter des contacts avec avatars.
J'ai fais en sorte que quand le membre pointe sa souris sur l'avatar de son contact, un
s'affiche pour montrer son adresse email, pseudo etc ...
Jusque là pas de problèmes cependant j'aimerais maintenant que le membre puisse supprimer le contact dans le
. C'est pourquoi je dois sur le lien "Supprimer ce contact" mettre des variables php que j'appelle avec ma base de donnée mais je n'arrive pas à le faire avec javascript.
Voici le code php que j'utilise pour afficher les contacts du membre.
echo'
';
while ($donnees = mysql_fetch_array($requete))
{
echo '
';
}
Explication :
$donnees['imgcontactl'] c'est tout simplement l'url de l'image du contact
onMouseover="showfloatie(\''.$donnees['email'].' \', event)" c'est la fonction qui appelle mon script JS
Voici maintenant le code JS.
var floatiewidth="621px"
var floatieheight="15px"
var floatiebgcolor=""
var fadespeed=70
var baseopacity=0
function slowhigh(which2){
imgobj=which2
browserdetect=which2.filters? "ie" : typeof which2.style.MozOpacity=="string"? "mozilla" : ""
instantset(baseopacity)
highlighting=setInterval("gradualfade(imgobj)",fadespeed)
}
function instantset(degree){
cleartimer()
if (browserdetect=="mozilla")
imgobj.style.MozOpacity=degree/100
else if (browserdetect=="ie")
imgobj.filters.alpha.opacity=degree
}
function cleartimer(){
if (window.highlighting) clearInterval(highlighting)
}
function gradualfade(cur2){
if (browserdetect=="mozilla" && cur2.style.MozOpacity<1)
cur2.style.MozOpacity=Math.min(parseFloat(cur2.style.MozOpacity)+0.1, 0.99)
else if (browserdetect=="ie" && cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=10
else if (window.highlighting)
clearInterval(highlighting)
}
function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
function paramexists(what){
return(typeof what!="undefined" && what!="")
}
function showfloatie(thetext, e, optbgColor, optWidth, optHeight){
var dsocx=(window.pageXOffset)? pageXOffset: ietruebody().scrollLeft;
var dsocy=(window.pageYOffset)? pageYOffset : ietruebody().scrollTop;
var floatobj=document.getElementById("des")
floatobj.style.display="block"
floatobj.style.backgroundColor=paramexists(optbgColor)? optbgColor : floatiebgcolor
floatobj.style.width=paramexists(optWidth)? optWidth+"px" : floatiewidth
floatobj.style.height=paramexists(optHeight)? optHeight+"px" : floatieheight!=""? floatieheight : ""
floatobj.innerHTML=thetext
var floatWidth=floatobj.offsetWidth>0? floatobj.offsetWidth : floatobj.style.width
var floatHeight=floatobj.offsetHeight>0? floatobj.offsetHeight : floatobj.style.width
var winWidth=document.all&&!window.opera? ietruebody().clientWidth : window.innerWidth-20
var winHeight=document.all&&!window.opera? ietruebody().clientHeight : window.innerHeight
e=window.event? window.event : e
floatobj.style.left=dsocx+winWidth-floatWidth-5+"px"
if (e.clientX>winWidth-floatWidth && e.clientY+20>winHeight-floatHeight)
floatobj.style.top=dsocy+5+"px"
else
floatobj.style.top=dsocy+winHeight-floatHeight-5+"px"
slowhigh(floatobj)
}
Voila j'espère que vous pourrez m'aider et surtout j'espère avoir été clair
cs_bultez
Messages postés13615Date d'inscriptionjeudi 13 février 2003StatutMembreDernière intervention15 octobre 201330 24 mars 2008 à 09:17
Bonjour,
certes... et il y a quoi dans $donnees['urlcontact'], dans $chaine[0]...
on devine comment ?
et décortique... <?php echo($donnees['urlcontact']);?> ... et le reste... pour voir
>>c'est que ce code n'accepte pas le < >
lesquels ?
et il doit manquer l'echo qui génère ça... alors avec les " ou les ' que tu
dois y mettre, probablement un conflit.