Jump to content

Tooltip overlaps on background text


sandy1028

Recommended Posts

#bubble_tooltip{
        width:400px;
        position:absolute;
        display:none;
        top:50px;
}
#bubble_tooltip .bubble_top{
        background-image: url('../bubb_top.gif');
        background-repeat:no-repeat;
        height:56px;
        top:10px;
}
#bubble_tooltip .bubble_middle{
        background-image: url('../bubb_middle.gif');
        background-repeat:repeat-y;
          padding-left:8px;
        padding-right:7px;
}
#bubble_tooltip .bubble_middle span{
        position:relative;
        font-family: Trebuchet MS, Lucida Sans Unicode, Arial, sans-serif;
        font-size:15px;

}
#bubble_tooltip .bubble_bottom{
        background-image: url('../bubb_bottom.gif');
        background-repeat:no-repeat;
        background-repeat:no-repeat;
        height:90px;
        position:relative;
      }

<script>
function showToolTip(e,text){
        if(document.all)e = event;

        var obj = document.getElementById('bubble_tooltip');
        var obj2 = document.getElementById('bubble_tooltip_content');
        obj2.innerHTML = text;
        obj.style.display = 'block';
        var st = Math.max(document.body.scrollTop,document.documentElement.scrollTop);
       // if(navigator.userAgent.toLowerCase().indexOf('safari')>=0)st=0;
        var leftPos = e.clientX - 70;
        if(leftPos<0)leftPos = 0;
        obj.style.left = leftPos + 'px';
        obj.style.top = e.clientY + 270- obj.offsetHeight -1 + st + 'px';
}

function hideToolTip()
{
        document.getElementById('bubble_tooltip').style.display = 'none';

}
</script>

<html>
<body>
<div id="bubble_tooltip">
        <div class="bubble_top"><span></span></div>
        <div class="bubble_middle"><span id="bubble_tooltip_content"></span></div>
        <div class="bubble_bottom"></div>
</div>

</body>
</html>

 

 

The tooltip overlaps on the text in the background. how to avoid it.

 

How to adjust the position depending on the textual information in tooltip.

 

Tooltip increases when amount of text inside it increases.

 

Problem is when i set the position in javascript to 270 if the amount of text is less the tooltip is moves down to 270px.

 

 

Tooltip bubble_middle increases as the amount of text increases..

 

 

 

Please help me how can i solve these problem

 

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.