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

JavaScript Discussion :

Recherche d'un script


Sujet :

JavaScript

  1. #1
    Candidat au Club
    Inscrit en
    Août 2006
    Messages
    5
    Détails du profil
    Informations forums :
    Inscription : Août 2006
    Messages : 5
    Points : 3
    Points
    3
    Par défaut Recherche d'un script
    Salut,
    je suis a la recherche d'un script qui afficherai une boite flottante avec du texte (relativement long et sur plusieurs lignes) quand on passe la souris sur du texte.

    Par exemple j'aimerai que quand je passe ma souris sur le mot 'voitures de marque', j'ai une boite de dialogue qui apparaisse avec toutes les marques existantes puis quand on retire la souris du mot, celle ci disparaisse.


    Merci

  2. #2
    Rédacteur/Modérateur

    Avatar de SpaceFrog
    Homme Profil pro
    Développeur Web Php Mysql Html Javascript CSS Apache - Intégrateur - Bidouilleur SharePoint
    Inscrit en
    Mars 2002
    Messages
    39 642
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 74
    Localisation : Royaume-Uni

    Informations professionnelles :
    Activité : Développeur Web Php Mysql Html Javascript CSS Apache - Intégrateur - Bidouilleur SharePoint
    Secteur : Industrie

    Informations forums :
    Inscription : Mars 2002
    Messages : 39 642
    Points : 66 668
    Points
    66 668
    Billets dans le blog
    1
    Par défaut
    ça ne s'appellerait pas une info bulle par hasard ?

  3. #3
    Candidat au Club
    Inscrit en
    Août 2006
    Messages
    5
    Détails du profil
    Informations forums :
    Inscription : Août 2006
    Messages : 5
    Points : 3
    Points
    3
    Par défaut
    Je sais pas.

    Je vais chercher de ce coté la.

    Merci

  4. #4
    Membre à l'essai
    Inscrit en
    Décembre 2003
    Messages
    15
    Détails du profil
    Informations personnelles :
    Âge : 50

    Informations forums :
    Inscription : Décembre 2003
    Messages : 15
    Points : 12
    Points
    12
    Par défaut
    Je ne sais pas si ça t'aidera, mais essai toujours .

    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
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    <script type="text/javascript">
    <!-- <![CDATA[
    // The following code is used to support the small popups that
    // give the full description of an event when the user move the
    // mouse over it.
     
    // Developer's note:
    // I (Benoit Maisonny <benoit@synclude.com>) tested this code with Mozilla 0.8.1 (on Linux),
    // with IE5.5 SP1 (on WinNT4) and with Netscape Communicator 4.74 (on Linux).
    // Netscape 6.0 and 6.01 seem to have a bug related to the visibility attribute.
    // I suppose it will be corrected as soon as they release a new version, based on
    // a more recent Mozilla source code.
    // I'm not able to test this javascript code with IE4. It'd be glad to know if it works.
     
    NS4 = (document.layers) ? 1 : 0;
    IE4 = (document.all) ? 1 : 0;
    W3C = (document.getElementById) ? 1 : 0;	
    // W3C stands for the W3C standard, implemented in Mozilla (and Netscape 6) and IE5
     
    // Function show(evt, name)
    //	evt is a pointer to the Event object passed when the event occurs
    //	name is the ID attribute of the element to show
    function show ( evt, name ) {
      if (IE4) {
        evt = window.event;  //is it necessary?
      }
     
      var currentX,		//mouse position on X axis
          currentY,		//mouse position on X axis
          x,		//layer target position on X axis
          y,		//layer target position on Y axis
          docWidth,		//width of current frame
          docHeight,	//height of current frame
          layerWidth,	//width of popup layer
          layerHeight,	//height of popup layer
          ele;		//points to the popup element
     
      // First let's initialize our variables
      if ( W3C ) {
        ele = document.getElementById(name);
        currentX = evt.clientX,
        currentY = evt.clientY;
        docWidth = document.width;
        docHeight = document.height;
        layerWidth = ele.style.width;
        layerHeight = ele.style.height;
     
      } else if ( NS4 ) {
        ele = document.layers[name];
        currentX = evt.pageX,
        currentY = evt.pageY;
        docWidth = document.width;
        docHeight = document.height;
        layerWidth = ele.clip.width;
        layerHeight = ele.clip.height;
     
      } else {	// meant for IE4
        ele = document.all[name];
        currentX = evt.clientX,
        currentY = evt.clientY;
        docHeight = document.body.offsetHeight;
        docWidth = document.body.offsetWidth;
        //var layerWidth = document.all[name].offsetWidth;
        // for some reason, this doesn't seem to work... so set it to 200
        layerWidth = 200;
        layerHeight = ele.offsetHeight;
      }
     
      // Then we calculate the popup element's new position
      if ( ( currentX + layerWidth ) > docWidth ) {
        x = ( currentX - layerWidth );
      }
      else {
        x = currentX;
      }
      if ( ( currentY + layerHeight ) >= docHeight ) {
         y = ( currentY - layerHeight - 20 );
      }
      else {
        y = currentY + 20;
      }
      if ( IE4 ) {
        x += document.body.scrollLeft;
        y += document.body.scrollTop;
      } else if ( NS4)  {
      } else {
        x += window.pageXOffset;
        y += window.pageYOffset;
      }
    // (for debugging purpose) alert("docWidth " + docWidth + ", docHeight " + docHeight + "\nlayerWidth " + layerWidth + ", layerHeight " + layerHeight + "\ncurrentX " + currentX + ", currentY " + currentY + "\nx " + x + ", y " + y);
     
      // Finally, we set its position and visibility
      if ( NS4 ) {
        //ele.xpos = parseInt ( x );
        ele.left = parseInt ( x );
        //ele.ypos = parseInt ( y );
        ele.top = parseInt ( y );
        ele.visibility = "show";
      } else {  // IE4 & W3C & Mozilla
        ele.style.left = parseInt ( x ) + "px";
        ele.style.top = parseInt ( y ) + "px";
        ele.style.visibility = "visible";
      }
    }
     
    function hide ( name ) {
      if (W3C) {
        document.getElementById(name).style.visibility = "hidden";
      } else if (NS4) {
        document.layers[name].visibility = "hide";
      } else {
        document.all[name].style.visibility = "hidden";
      }
    }
     
    function unhide ( name ) {
      if (W3C) {
        document.getElementById(name).style.visibility = "visible";
      } else if (NS4) {
        document.layers[name].visibility = "show";
      } else {
        document.all[name].style.visibility = "visible";
      }
    }
     
    //]]> -->
    </script>

  5. #5
    Candidat au Club
    Inscrit en
    Août 2006
    Messages
    5
    Détails du profil
    Informations forums :
    Inscription : Août 2006
    Messages : 5
    Points : 3
    Points
    3
    Par défaut
    Merci pour ton aide.

    @+

  6. #6
    Membre à l'essai
    Inscrit en
    Décembre 2003
    Messages
    15
    Détails du profil
    Informations personnelles :
    Âge : 50

    Informations forums :
    Inscription : Décembre 2003
    Messages : 15
    Points : 12
    Points
    12
    Par défaut
    J'espère t'avoir aider.

    Si ça fonctonne, noublie pas de cliquer sur resolut....

  7. #7
    Expert éminent

    Avatar de denisC
    Profil pro
    Développeur Java
    Inscrit en
    Février 2005
    Messages
    4 050
    Détails du profil
    Informations personnelles :
    Âge : 44
    Localisation : Canada

    Informations professionnelles :
    Activité : Développeur Java
    Secteur : Service public

    Informations forums :
    Inscription : Février 2005
    Messages : 4 050
    Points : 7 641
    Points
    7 641
    Par défaut
    Citation Envoyé par SpaceFrog
    ça ne s'appellerait pas une info bulle par hasard ?
    http://torvalds17.free.fr/partiePubl....php5?script=1

Discussions similaires

  1. [Mail] A la recherche d'un script efficace
    Par lvr dans le forum EDI, CMS, Outils, Scripts et API
    Réponses: 1
    Dernier message: 22/04/2009, 10h41
  2. recherche d'un script pour fermeture de fenetre du navigateur
    Par pat 43 dans le forum Général JavaScript
    Réponses: 1
    Dernier message: 10/12/2007, 15h29
  3. Recherche un bon script de forum en ASP.NET
    Par zooffy dans le forum Général Dotnet
    Réponses: 10
    Dernier message: 13/12/2006, 17h10
  4. Recherche d'un script PHP pour renommer des fichiers en masse
    Par pekka77 dans le forum EDI, CMS, Outils, Scripts et API
    Réponses: 3
    Dernier message: 19/11/2006, 23h43
  5. [MySQL] Formulaire de recherche PHP + un script d recherche en HTML
    Par Dsphinx dans le forum PHP & Base de données
    Réponses: 6
    Dernier message: 09/11/2005, 19h44

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