Jump to content

[SOLVED] onmouseover()


sandy1028

Recommended Posts

How to hide the orange tooltip. It should be displayed only when mouse over the text in li

 


[syntax="css"]
<style type="text/css">
.roundcont {
        width: 250px;
        background-color: #f90;
        color: #fff;
}
.roundcont p {
        margin: 0 10px;
}
.roundtop {
        background: url(tr.gif) no-repeat top right;
}
.roundbottom {
        background: url(br.gif) no-repeat top right;
}
img.corner {
   width: 15px;
   height: 15px;
   border: none;
   display: block !important;
}

</style>
[/syntax]

[syntax="javascript"]
<script>
function showdiv(){
var tip;
tip = document.getElementById("one");
tip.style.display ="block";
}

function hidediv(){
var tip;
tip = document.getElementById("one");
tip.style.display ="none";
}

</script>
[/syntax]





[syntax="html"]
<div id="one">
<li onMouseOver="javascript:showdiv(); onMouseOut="hidediv();>--Somename
<div class="roundcont">
   <div class="roundtop">
         <img src="tl.gif" width="15" height="15" class="corner"  style="display: none" />
   </div>

<p> On mouse over</p>
      <div class="roundbottom">
         <img src="bl.gif" width="15" height="15" class="corner" style="display: none" />
      </div>
   </div>
</li>
</div>
</div>
[/syntax]

Link to comment
Share on other sites

better to use a tags and then you can do this without js...

 

<div id="one">
<a href="#" class="tootip">--Somename
<div class="roundcont">
   <div class="roundtop">
         <img src="tl.gif" width="15" height="15" class="corner"  style="display: none" />
   </div>

<p> On mouse over</p>
      <div class="roundbottom">
         <img src="bl.gif" width="15" height="15" class="corner" style="display: none" />
      </div>
   </div>
</a>
</div>
</div>

 

the css

 


.roundcont {
        width: 250px;
        background-color: #f90;
        color: #fff;
}
.roundcont p {
        margin: 0 10px;
}
.roundtop {
        background: url(tr.gif) no-repeat top right;
}
.roundbottom {
        background: url(br.gif) no-repeat top right;
}
img.corner {
   width: 15px;
   height: 15px;
   border: none;
   display: block !important;
}
// THE NEW STUFF

a tooltip
{
position: relative;
}

a.tooltip div.roundcont
{
display: none;
}

a:hover.tootip div.roundcont
{
display: block;
position: absolute;
top: 0;
left: 0;
}

 

have fun ;)

 

 

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.