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

Pentaho Discussion :

Cacher "Hide()" une infobulle


Sujet :

Pentaho

  1. #1
    Membre du Club
    Femme Profil pro
    Inscrit en
    Janvier 2012
    Messages
    109
    Détails du profil
    Informations personnelles :
    Sexe : Femme

    Informations forums :
    Inscription : Janvier 2012
    Messages : 109
    Points : 56
    Points
    56
    Par défaut Cacher "Hide()" une infobulle
    Bonjour,
    J'ai créer une infobulle qui permet d'afficher des informations en survolant une colonne du tableau d'un rapport créer sous Pentaho Report designer,
    Bon, voila le code script que je le colle au niveau de Master-Report -> attributes html -> append-body :
    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
     
    <script type="text/javascript">
    var tooltip=function(){
     var id = 'tt';
     var top = 3;
     var left = 3;
     var maxw = 300;
     var speed = 10;
     var timer = 20;
     var endalpha = 95;
     var alpha = 0;
     var tt,t,c,b,h;
     var ie = document.all ? true : false;
     return{
      show:function(v,w){
       if(tt == null){
        tt = document.createElement('div');
        tt.setAttribute('id',id);
        t = document.createElement('div');
        t.setAttribute('id',id + 'top');
        c = document.createElement('div');
        c.setAttribute('id',id + 'cont');
        b = document.createElement('div');
        b.setAttribute('id',id + 'bot');
        tt.appendChild(t);
        tt.appendChild(c);
        tt.appendChild(b);
        document.body.appendChild(tt);
        tt.style.opacity = 0;
        tt.style.filter = 'alpha(opacity=0)';
        document.onmousemove = this.pos;
       }
       tt.style.display = 'block';
       c.innerHTML = v;
       tt.style.width = w ? w + 'px' : 'auto';
       if(!w && ie){
        t.style.display = 'none';
        b.style.display = 'none';
        tt.style.width = tt.offsetWidth;
        t.style.display = 'block';
        b.style.display = 'block';
       }
      if(tt.offsetWidth > maxw){tt.style.width = maxw + 'px'}
      h = parseInt(tt.offsetHeight) + top;
      clearInterval(tt.timer);
      tt.timer = setInterval(function(){tooltip.fade(1)},timer);
      },
      pos:function(e){
       var u = ie ? event.clientY + document.documentElement.scrollTop : e.pageY;
       var l = ie ? event.clientX + document.documentElement.scrollLeft : e.pageX;
       tt.style.top = (u - h) + 'px';
       tt.style.left = (l + left) + 'px';
      },
      fade:function(d){
       var a = alpha;
       if((a != endalpha && d == 1) || (a != 0 && d == -1)){
        var i = speed;
       if(endalpha - a < speed && d == 1){
        i = endalpha - a;
       }else if(alpha < speed && d == -1){
         i = a;
       }
       alpha = a + (i * d);
       tt.style.opacity = alpha * .01;
       tt.style.filter = 'alpha(opacity=' + alpha + ')';
      }else{
        clearInterval(tt.timer);
         if(d == -1){tt.style.display = 'none'}
      }
     },
     hide:function(){
      clearInterval(tt.timer);
       tt.timer = setInterval(function(){tooltip.fade(-1)},timer);
      }
     };
    }();
    </script>
    <style type="text/css">
    #tt {
     position:absolute;
     display:block;
     background:url(images/tt_left.gif) top left no-repeat;
     }
     #tttop {
     display:block;
     height:5px;
     margin-left:5px;
     background:url(images/tt_top.gif) top right no-repeat;
     overflow:hidden;
     }
     #ttcont {
     display:block;
     padding:2px 12px 3px 7px;
     margin-left:5px;
     background:#666;
     color:#fff;
     }
    #ttbot {
    display:block;
    height:5px;
    margin-left:5px;
    background:url(images/tt_bottom.gif) top right no-repeat;
    overflow:hidden;
    }
    </style>
    et pour appliquer ce script je sélectionne la colonne Attributes -> html-events
    dans l'attribut : on-mouse-over je tape :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    tooltip.show('Testing  123 ', 200);
    et dans l'attribut : on-mouse-out je tape :
    Mais le problème qui se pose, c'est que l'infobulle ne disparu pas lorsque je quitte la colonne même que j'ai tenir compte l'attribut "on-mouse-out".
    Alors qui ce que vous proposez.
    Merci d'avance.

  2. #2
    Membre du Club
    Femme Profil pro
    Inscrit en
    Janvier 2012
    Messages
    109
    Détails du profil
    Informations personnelles :
    Sexe : Femme

    Informations forums :
    Inscription : Janvier 2012
    Messages : 109
    Points : 56
    Points
    56

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

Discussions similaires

  1. Cacher "Hide()" une infobulle
    Par nancy169 dans le forum Général JavaScript
    Réponses: 8
    Dernier message: 09/09/2012, 17h35

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