IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

HTML Discussion :

[HTML] Positionnement d'une Tooltip


Sujet :

HTML

  1. #1
    Candidat au Club
    Inscrit en
    Juillet 2005
    Messages
    2
    Détails du profil
    Informations forums :
    Inscription : Juillet 2005
    Messages : 2
    Points : 2
    Points
    2
    Par défaut [HTML] Positionnement d'une Tooltip
    Bonjour,
    j'ai un script qui me permet d'afficher un Tooltip. Problème: il apparaît toujours à droite de l'écran. Je voudrais qu'il apparaisse à gauche de l'écran.
    Voilà le code que j'utilise:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
     
     
    Dans <HEAD>
    <style type="text/css">
    #dhtmlfloatie{
    position: absolute;
    left: 0;
    left: -900px;
    filter:alpha(opacity=0);
    -moz-opacity:0;
    border: 2px solid black;
    padding: 5px;
    z-index: 100;
    }
    </style>
     
    <script type="text/javascript">
    /***********************************************
    * Link Floatie script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * This notice MUST stay intact for legal use
    * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
    ***********************************************/
    var floattext=new Array()
     
    <!--data : nom du fichier html du CV-->
    floattext[0]='<object data="ec02-037.htm" type="text/html" width="700" height="500"></object><div align="right"><a ref="javascript:hidefloatie()">Hide Box</a></div>'
                                    
    var floatiewidth="250px" //default width of floatie in px
    var floatieheight="60px" //default height of floatie in px. Set to "" to let floatie content dictate height.
    var floatiebgcolor="lightyellow" //default bgcolor of floatie
    var fadespeed=70 //speed of fade (5 or above). Smaller=faster.
            
    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("dhtmlfloatie")
    floatobj.style.left="-900px"
    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)
    }
                    
    function hidefloatie(){
    var floatobj=document.getElementById("dhtmlfloatie")
    floatobj.style.display="none"
    }
    </script>
     
    Dans <BODY>
     
    <div id="dhtmlfloatie"></div>
    <TD id="cellule" width="22%"><A style="color:#0000EE;" href="contenu.html" onMouseover="showfloatie(floattext[0], event, '#D9FFD9', 700, 500)">Plus</A></TD>
    Quelqu'un peut m'aider à modifier le code pour que le Tooltip apparaisse à droite?.
    Merci d'avance

  2. #2
    Membre éclairé
    Profil pro
    Inscrit en
    Octobre 2004
    Messages
    882
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2004
    Messages : 882
    Points : 691
    Points
    691
    Par défaut
    je sais pas quelle positionement tu veut
    tu peut essayer
    float:right
    ou en absolu
    left:auto;
    right:0;

  3. #3
    Candidat au Club
    Inscrit en
    Juillet 2005
    Messages
    2
    Détails du profil
    Informations forums :
    Inscription : Juillet 2005
    Messages : 2
    Points : 2
    Points
    2
    Par défaut
    Merci bcp

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Positionnement d'une popup HTML
    Par yann123456 dans le forum Mise en page CSS
    Réponses: 7
    Dernier message: 13/08/2009, 18h08
  2. [HTML] Positionner une image sur la marge gauche
    Par m_piou dans le forum Balisage (X)HTML et validation W3C
    Réponses: 4
    Dernier message: 11/02/2008, 09h28
  3. [HTML] Positionnement dans une page web
    Par pasqwal dans le forum Balisage (X)HTML et validation W3C
    Réponses: 3
    Dernier message: 26/10/2006, 15h53
  4. Réponses: 6
    Dernier message: 10/04/2006, 12h10
  5. Réponses: 2
    Dernier message: 20/07/2005, 13h33

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo